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 /include/list | |
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 'include/list')
-rw-r--r-- | include/list | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/list b/include/list index 5e76d1103..20a66c360 100644 --- a/include/list +++ b/include/list @@ -177,14 +177,16 @@ template <class T, class Alloc> #include <algorithm> #include <type_traits> -#include <__undef_min_max> - #include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp, class _VoidPtr> struct __list_node; @@ -2415,4 +2417,6 @@ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y) _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP_LIST |