[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
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: a016efb1dcda61e606e527b73791fbacf1bc9c86
diff --git a/include/optional b/include/optional
index 70b6eb4..8c8ee76 100644
--- a/include/optional
+++ b/include/optional
@@ -146,7 +146,6 @@
 #include <__config>
 #include <__debug>
 #include <__functional_base>
-#include <__undef_min_max>
 #include <functional>
 #include <initializer_list>
 #include <new>
@@ -158,6 +157,10 @@
 #pragma GCC system_header
 #endif
 
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+
 namespace std  // purposefully not using versioning namespace
 {
 
@@ -1315,4 +1318,6 @@
 
 #endif  // _LIBCPP_STD_VER > 14
 
+_LIBCPP_POP_MACROS
+
 #endif  // _LIBCPP_OPTIONAL