summaryrefslogtreecommitdiff
path: root/include/string_view
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/string_view
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/string_view')
-rw-r--r--include/string_view7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/string_view b/include/string_view
index e59f099f1..75374d2cb 100644
--- a/include/string_view
+++ b/include/string_view
@@ -166,7 +166,6 @@ namespace std {
*/
#include <__config>
-
#include <__string>
#include <algorithm>
#include <iterator>
@@ -178,6 +177,10 @@ namespace std {
#pragma GCC system_header
#endif
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+
_LIBCPP_BEGIN_NAMESPACE_STD
template<class _CharT, class _Traits = char_traits<_CharT> >
@@ -784,4 +787,6 @@ inline namespace literals
#endif
_LIBCPP_END_NAMESPACE_STD
+_LIBCPP_POP_MACROS
+
#endif // _LIBCPP_STRING_VIEW