diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -634,9 +634,6 @@ if (LIBCXX_ENABLE_PEDANTIC) target_add_compile_flags_if_supported(${target} PRIVATE -pedantic) endif() - if (LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS) - target_compile_definitions(${target} PRIVATE -D_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) - endif() endfunction() # Exception flags ============================================================= diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -1235,35 +1235,8 @@ #define _LIBCPP_HAS_NO_CXX20_COROUTINES #endif -#if defined(_LIBCPP_COMPILER_IBM) -#define _LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO -#endif - -#if defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) -# define _LIBCPP_PUSH_MACROS -# define _LIBCPP_POP_MACROS -#else - // Don't warn about macro conflicts when we can restore them at the - // end of the header. -# ifndef _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS -# define _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS -# endif -# if defined(_LIBCPP_COMPILER_MSVC) -# define _LIBCPP_PUSH_MACROS \ - __pragma(push_macro("min")) \ - __pragma(push_macro("max")) -# define _LIBCPP_POP_MACROS \ - __pragma(pop_macro("min")) \ - __pragma(pop_macro("max")) -# else -# define _LIBCPP_PUSH_MACROS \ - _Pragma("push_macro(\"min\")") \ - _Pragma("push_macro(\"max\")") -# define _LIBCPP_POP_MACROS \ - _Pragma("pop_macro(\"min\")") \ - _Pragma("pop_macro(\"max\")") -# endif -#endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")") +# define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")") #ifndef _LIBCPP_NO_AUTO_LINK # if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) diff --git a/libcxx/include/__undef_macros b/libcxx/include/__undef_macros --- a/libcxx/include/__undef_macros +++ b/libcxx/include/__undef_macros @@ -7,27 +7,10 @@ // //===----------------------------------------------------------------------===// - #ifdef min -#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) -#if defined(_LIBCPP_WARNING) -_LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX " - "before any Windows header. #undefing min") -#else -#warning: macro min is incompatible with C++. #undefing min -#endif -#endif -#undef min +# undef min #endif #ifdef max -#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) -#if defined(_LIBCPP_WARNING) -_LIBCPP_WARNING("macro max is incompatible with C++. Try #define NOMINMAX " - "before any Windows header. #undefing max") -#else -#warning: macro max is incompatible with C++. #undefing max -#endif -#endif -#undef max +# undef max #endif