diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-05-31 22:07:49 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-05-31 22:07:49 +0000 |
commit | 018a3d51a47f7275c59e802709104498b729522b (patch) | |
tree | 0b1dd3dc5ebbdfa46c3eedcb185115521941e154 /src | |
parent | 256425754dd739443c3f2913f482655c1425e1a3 (diff) |
[Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows
Summary:
This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning.
This patch changes libc++ to use `#pragma push_macro` to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header.
Reviewers: mclow.lists, bcraig, compnerd, EricWF
Reviewed By: EricWF
Subscribers: cfe-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D33080
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src')
-rw-r--r-- | src/condition_variable.cpp | 1 | ||||
-rw-r--r-- | src/ios.cpp | 1 | ||||
-rw-r--r-- | src/locale.cpp | 1 | ||||
-rw-r--r-- | src/mutex.cpp | 1 | ||||
-rw-r--r-- | src/strstream.cpp | 1 |
5 files changed, 5 insertions, 0 deletions
diff --git a/src/condition_variable.cpp b/src/condition_variable.cpp index 3f607271b..2200aefb8 100644 --- a/src/condition_variable.cpp +++ b/src/condition_variable.cpp @@ -14,6 +14,7 @@ #include "condition_variable" #include "thread" #include "system_error" +#include "__undef_macros" _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/src/ios.cpp b/src/ios.cpp index 7c76ca258..0f1d88e37 100644 --- a/src/ios.cpp +++ b/src/ios.cpp @@ -22,6 +22,7 @@ #include "new" #include "streambuf" #include "string" +#include "__undef_macros" _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/src/locale.cpp b/src/locale.cpp index 4163c2c0a..3d61fbede 100644 --- a/src/locale.cpp +++ b/src/locale.cpp @@ -36,6 +36,7 @@ #endif #include <stdlib.h> #include <stdio.h> +#include "__undef_macros" // On Linux, wint_t and wchar_t have different signed-ness, and this causes // lots of noise in the build log, but no bugs that I know of. diff --git a/src/mutex.cpp b/src/mutex.cpp index b858e8877..c36bd5549 100644 --- a/src/mutex.cpp +++ b/src/mutex.cpp @@ -12,6 +12,7 @@ #include "limits" #include "system_error" #include "include/atomic_support.h" +#include "__undef_macros" _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_HAS_NO_THREADS diff --git a/src/strstream.cpp b/src/strstream.cpp index be94f9c89..01523cf45 100644 --- a/src/strstream.cpp +++ b/src/strstream.cpp @@ -13,6 +13,7 @@ #include "cstring" #include "cstdlib" #include "__debug" +#include "__undef_macros" _LIBCPP_BEGIN_NAMESPACE_STD |