summaryrefslogtreecommitdiff
path: root/include/shared_mutex
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-05-31 22:07:49 +0000
committerEric Fiselier <eric@efcs.ca>2017-05-31 22:07:49 +0000
commit018a3d51a47f7275c59e802709104498b729522b (patch)
tree0b1dd3dc5ebbdfa46c3eedcb185115521941e154 /include/shared_mutex
parent256425754dd739443c3f2913f482655c1425e1a3 (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 'include/shared_mutex')
-rw-r--r--include/shared_mutex8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/shared_mutex b/include/shared_mutex
index ff36ee6ac..9cb81528c 100644
--- a/include/shared_mutex
+++ b/include/shared_mutex
@@ -125,12 +125,14 @@ template <class Mutex>
#include <__config>
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+
#if _LIBCPP_STD_VER > 11 || defined(_LIBCPP_BUILDING_SHARED_MUTEX)
#include <__mutex_base>
-#include <__undef_min_max>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -500,4 +502,6 @@ _LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER > 11
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP_SHARED_MUTEX