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 | a016efb1dcda61e606e527b73791fbacf1bc9c86 (patch) | |
| tree | f98a8a9a31a14d8d72c4d549467288b5dce6e594 /libcxx/include/__hash_table | |
| parent | 0b69e363f65b9207d42213f546a9e2fa55c503be (diff) | |
| download | bcm5719-llvm-a016efb1dcda61e606e527b73791fbacf1bc9c86.tar.gz bcm5719-llvm-a016efb1dcda61e606e527b73791fbacf1bc9c86.zip | |
[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
llvm-svn: 304357
Diffstat (limited to 'libcxx/include/__hash_table')
| -rw-r--r-- | libcxx/include/__hash_table | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table index acdc443a640..79336ff793e 100644 --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -20,16 +20,17 @@ #include <utility> #include <type_traits> -#include <__undef_min_max> - #include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_CXX03_LANG template <class _Key, class _Tp> @@ -2667,6 +2668,9 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__subscriptable(const const_iterator*, } #endif // _LIBCPP_DEBUG_LEVEL >= 2 + _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP__HASH_TABLE |

