Index: libcxx/include/__config =================================================================== --- libcxx/include/__config +++ libcxx/include/__config @@ -1141,8 +1141,8 @@ # define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS # endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES -# define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")") -# define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")") +# define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")") _Pragma("push_macro(\"refresh()\")") _Pragma("push_macro(\"move(int, int)\")") _Pragma("push_macro(\"erase()\")") +# define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")") _Pragma("pop_macro(\"refresh()\")") _Pragma("pop_macro(\"move(int, int)\")") _Pragma("pop_macro(\"erase()\")") # ifndef _LIBCPP_NO_AUTO_LINK # if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) Index: libcxx/include/__undef_macros =================================================================== --- libcxx/include/__undef_macros +++ libcxx/include/__undef_macros @@ -14,3 +14,15 @@ #ifdef max # undef max #endif + +#ifdef refresh +# undef refresh +#endif + +#ifdef move +# undef move +#endif + +#ifdef erase +# undef erase +#endif Index: libcxx/include/__utility/move.h =================================================================== --- libcxx/include/__utility/move.h +++ libcxx/include/__utility/move.h @@ -20,6 +20,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -41,4 +44,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_MOVE_H Index: libcxx/test/libcxx/nasty_macros.compile.pass.cpp =================================================================== --- libcxx/test/libcxx/nasty_macros.compile.pass.cpp +++ libcxx/test/libcxx/nasty_macros.compile.pass.cpp @@ -142,6 +142,19 @@ #define min NASTY_MACRO #define max NASTY_MACRO +// Test to make sure curses has no conflicting macros with the standard library +#ifndef refresh +# define refresh NASTY_MACRO +#endif + +#ifndef move +# define move NASTY_MACRO +#endif + +#ifndef erase +# define erase NASTY_MACRO +#endif + /* BEGIN-SCRIPT