Index: libcxx/include/__algorithm/adjacent_find.h =================================================================== --- libcxx/include/__algorithm/adjacent_find.h +++ libcxx/include/__algorithm/adjacent_find.h @@ -20,6 +20,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -50,4 +53,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_ADJACENT_FIND_H Index: libcxx/include/__algorithm/in_out_result.h =================================================================== --- libcxx/include/__algorithm/in_out_result.h +++ libcxx/include/__algorithm/in_out_result.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -50,4 +53,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_IN_OUT_RESULT_H Index: libcxx/include/__algorithm/is_permutation.h =================================================================== --- libcxx/include/__algorithm/is_permutation.h +++ libcxx/include/__algorithm/is_permutation.h @@ -26,6 +26,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -235,4 +238,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_IS_PERMUTATION_H Index: libcxx/include/__algorithm/iterator_operations.h =================================================================== --- libcxx/include/__algorithm/iterator_operations.h +++ libcxx/include/__algorithm/iterator_operations.h @@ -33,6 +33,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template struct _IterOps; @@ -172,4 +175,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_ITERATOR_OPERATIONS_H Index: libcxx/include/__algorithm/make_heap.h =================================================================== --- libcxx/include/__algorithm/make_heap.h +++ libcxx/include/__algorithm/make_heap.h @@ -21,6 +21,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -52,4 +55,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_MAKE_HEAP_H Index: libcxx/include/__algorithm/min_element.h =================================================================== --- libcxx/include/__algorithm/min_element.h +++ libcxx/include/__algorithm/min_element.h @@ -22,6 +22,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -66,4 +69,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_MIN_ELEMENT_H Index: libcxx/include/__algorithm/pop_heap.h =================================================================== --- libcxx/include/__algorithm/pop_heap.h +++ libcxx/include/__algorithm/pop_heap.h @@ -25,6 +25,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -70,4 +73,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_POP_HEAP_H Index: libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h =================================================================== --- libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h +++ libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +# include <__undef_macros> + #if !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 // This backend implementation is for testing purposes only and not meant for production use. This will be replaced @@ -70,4 +73,6 @@ #endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && && _LIBCPP_STD_VER >= 17 +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_THREAD_H Index: libcxx/include/__algorithm/push_heap.h =================================================================== --- libcxx/include/__algorithm/push_heap.h +++ libcxx/include/__algorithm/push_heap.h @@ -22,6 +22,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -74,4 +77,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_PUSH_HEAP_H Index: libcxx/include/__algorithm/sift_down.h =================================================================== --- libcxx/include/__algorithm/sift_down.h +++ libcxx/include/__algorithm/sift_down.h @@ -19,6 +19,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -111,4 +114,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_SIFT_DOWN_H Index: libcxx/include/__algorithm/unwrap_iter.h =================================================================== --- libcxx/include/__algorithm/unwrap_iter.h +++ libcxx/include/__algorithm/unwrap_iter.h @@ -21,6 +21,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD // TODO: Change the name of __unwrap_iter_impl to something more appropriate @@ -77,4 +80,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_PUSH_MACROS + #endif // _LIBCPP___ALGORITHM_UNWRAP_ITER_H Index: libcxx/include/__algorithm/upper_bound.h =================================================================== --- libcxx/include/__algorithm/upper_bound.h +++ libcxx/include/__algorithm/upper_bound.h @@ -25,6 +25,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -60,4 +63,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_UPPER_BOUND_H Index: libcxx/include/__concepts/swappable.h =================================================================== --- libcxx/include/__concepts/swappable.h +++ libcxx/include/__concepts/swappable.h @@ -28,6 +28,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -115,4 +118,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___CONCEPTS_SWAPPABLE_H Index: libcxx/include/__config =================================================================== --- libcxx/include/__config +++ libcxx/include/__config @@ -1164,8 +1164,10 @@ # 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\")") +// clang-format off +# 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()\")") +// clang-format on # ifndef _LIBCPP_NO_AUTO_LINK # if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) Index: libcxx/include/__expected/bad_expected_access.h =================================================================== --- libcxx/include/__expected/bad_expected_access.h +++ libcxx/include/__expected/bad_expected_access.h @@ -17,6 +17,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +# include <__undef_macros> + #if _LIBCPP_STD_VER >= 23 _LIBCPP_BEGIN_NAMESPACE_STD @@ -60,4 +63,6 @@ #endif // _LIBCPP_STD_VER >= 23 +_LIBCPP_POP_MACROS + #endif // _LIBCPP___EXPECTED_BAD_EXPECTED_ACCESS_H Index: libcxx/include/__expected/expected.h =================================================================== --- libcxx/include/__expected/expected.h +++ libcxx/include/__expected/expected.h @@ -58,6 +58,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + #if _LIBCPP_STD_VER >= 23 _LIBCPP_BEGIN_NAMESPACE_STD @@ -1545,4 +1548,6 @@ #endif // _LIBCPP_STD_VER >= 23 +_LIBCPP_POP_MACROS + #endif // _LIBCPP___EXPECTED_EXPECTED_H Index: libcxx/include/__expected/unexpected.h =================================================================== --- libcxx/include/__expected/unexpected.h +++ libcxx/include/__expected/unexpected.h @@ -31,6 +31,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + #if _LIBCPP_STD_VER >= 23 _LIBCPP_BEGIN_NAMESPACE_STD @@ -119,4 +122,6 @@ #endif // _LIBCPP_STD_VER >= 23 +_LIBCPP_POP_MACROS + #endif // _LIBCPP___EXPECTED_UNEXPECTED_H Index: libcxx/include/__functional/perfect_forward.h =================================================================== --- libcxx/include/__functional/perfect_forward.h +++ libcxx/include/__functional/perfect_forward.h @@ -24,6 +24,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 @@ -94,4 +97,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H Index: libcxx/include/__iterator/advance.h =================================================================== --- libcxx/include/__iterator/advance.h +++ libcxx/include/__iterator/advance.h @@ -29,6 +29,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -199,4 +202,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_ADVANCE_H Index: libcxx/include/__iterator/back_insert_iterator.h =================================================================== --- libcxx/include/__iterator/back_insert_iterator.h +++ libcxx/include/__iterator/back_insert_iterator.h @@ -21,6 +21,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_SUPPRESS_DEPRECATED_PUSH @@ -70,4 +73,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H Index: libcxx/include/__iterator/bounded_iter.h =================================================================== --- libcxx/include/__iterator/bounded_iter.h +++ libcxx/include/__iterator/bounded_iter.h @@ -23,6 +23,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD // Iterator wrapper that carries the valid range it is allowed to access. @@ -229,4 +232,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_BOUNDED_ITER_H Index: libcxx/include/__iterator/common_iterator.h =================================================================== --- libcxx/include/__iterator/common_iterator.h +++ libcxx/include/__iterator/common_iterator.h @@ -34,6 +34,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -295,4 +298,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_COMMON_ITERATOR_H Index: libcxx/include/__iterator/counted_iterator.h =================================================================== --- libcxx/include/__iterator/counted_iterator.h +++ libcxx/include/__iterator/counted_iterator.h @@ -34,6 +34,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -308,4 +311,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_COUNTED_ITERATOR_H Index: libcxx/include/__iterator/erase_if_container.h =================================================================== --- libcxx/include/__iterator/erase_if_container.h +++ libcxx/include/__iterator/erase_if_container.h @@ -16,6 +16,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -37,4 +40,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H Index: libcxx/include/__iterator/front_insert_iterator.h =================================================================== --- libcxx/include/__iterator/front_insert_iterator.h +++ libcxx/include/__iterator/front_insert_iterator.h @@ -21,6 +21,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_SUPPRESS_DEPRECATED_PUSH @@ -68,4 +71,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H Index: libcxx/include/__iterator/insert_iterator.h =================================================================== --- libcxx/include/__iterator/insert_iterator.h +++ libcxx/include/__iterator/insert_iterator.h @@ -22,6 +22,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -78,4 +81,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_INSERT_ITERATOR_H Index: libcxx/include/__iterator/iter_move.h =================================================================== --- libcxx/include/__iterator/iter_move.h +++ libcxx/include/__iterator/iter_move.h @@ -23,6 +23,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -101,4 +104,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_ITER_MOVE_H Index: libcxx/include/__iterator/iter_swap.h =================================================================== --- libcxx/include/__iterator/iter_swap.h +++ libcxx/include/__iterator/iter_swap.h @@ -26,6 +26,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -110,4 +113,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_ITER_SWAP_H Index: libcxx/include/__iterator/move_iterator.h =================================================================== --- libcxx/include/__iterator/move_iterator.h +++ libcxx/include/__iterator/move_iterator.h @@ -39,6 +39,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -347,4 +350,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_MOVE_ITERATOR_H Index: libcxx/include/__iterator/move_sentinel.h =================================================================== --- libcxx/include/__iterator/move_sentinel.h +++ libcxx/include/__iterator/move_sentinel.h @@ -19,6 +19,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -56,4 +59,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_MOVE_SENTINEL_H Index: libcxx/include/__memory/allocation_guard.h =================================================================== --- libcxx/include/__memory/allocation_guard.h +++ libcxx/include/__memory/allocation_guard.h @@ -19,6 +19,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD // Helper class to allocate memory using an Allocator in an exception safe @@ -80,4 +83,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___MEMORY_ALLOCATION_GUARD_H Index: libcxx/include/__memory/compressed_pair.h =================================================================== --- libcxx/include/__memory/compressed_pair.h +++ libcxx/include/__memory/compressed_pair.h @@ -31,6 +31,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD // Tag used to default initialize one or both of the pair's elements. @@ -174,4 +177,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___MEMORY_COMPRESSED_PAIR_H Index: libcxx/include/__memory/construct_at.h =================================================================== --- libcxx/include/__memory/construct_at.h +++ libcxx/include/__memory/construct_at.h @@ -26,6 +26,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD // construct_at @@ -127,4 +130,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___MEMORY_CONSTRUCT_AT_H Index: libcxx/include/__memory/ranges_construct_at.h =================================================================== --- libcxx/include/__memory/ranges_construct_at.h +++ libcxx/include/__memory/ranges_construct_at.h @@ -28,6 +28,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -122,4 +125,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___MEMORY_RANGES_CONSTRUCT_AT_H Index: libcxx/include/__memory/unique_ptr.h =================================================================== --- libcxx/include/__memory/unique_ptr.h +++ libcxx/include/__memory/unique_ptr.h @@ -44,6 +44,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -743,4 +746,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___MEMORY_UNIQUE_PTR_H Index: libcxx/include/__memory/uses_allocator_construction.h =================================================================== --- libcxx/include/__memory/uses_allocator_construction.h +++ libcxx/include/__memory/uses_allocator_construction.h @@ -23,6 +23,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 @@ -218,4 +221,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___MEMORY_USES_ALLOCATOR_CONSTRUCTION_H Index: libcxx/include/__node_handle =================================================================== --- libcxx/include/__node_handle +++ libcxx/include/__node_handle @@ -68,6 +68,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 @@ -251,4 +254,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NODE_HANDLE Index: libcxx/include/__numeric/accumulate.h =================================================================== --- libcxx/include/__numeric/accumulate.h +++ libcxx/include/__numeric/accumulate.h @@ -17,6 +17,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -49,4 +52,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_ACCUMULATE_H Index: libcxx/include/__numeric/adjacent_difference.h =================================================================== --- libcxx/include/__numeric/adjacent_difference.h +++ libcxx/include/__numeric/adjacent_difference.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -69,4 +72,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_ADJACENT_DIFFERENCE_H Index: libcxx/include/__numeric/exclusive_scan.h =================================================================== --- libcxx/include/__numeric/exclusive_scan.h +++ libcxx/include/__numeric/exclusive_scan.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 @@ -50,4 +53,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_EXCLUSIVE_SCAN_H Index: libcxx/include/__numeric/inner_product.h =================================================================== --- libcxx/include/__numeric/inner_product.h +++ libcxx/include/__numeric/inner_product.h @@ -17,6 +17,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -50,4 +53,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_INNER_PRODUCT_H Index: libcxx/include/__numeric/partial_sum.h =================================================================== --- libcxx/include/__numeric/partial_sum.h +++ libcxx/include/__numeric/partial_sum.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -67,4 +70,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_PARTIAL_SUM_H Index: libcxx/include/__ranges/as_rvalue_view.h =================================================================== --- libcxx/include/__ranges/as_rvalue_view.h +++ libcxx/include/__ranges/as_rvalue_view.h @@ -28,6 +28,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + #if _LIBCPP_STD_VER >= 23 _LIBCPP_BEGIN_NAMESPACE_STD @@ -134,4 +137,6 @@ #endif // _LIBCPP_STD_VER >= 23 +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_AS_RVALUE_H Index: libcxx/include/__ranges/common_view.h =================================================================== --- libcxx/include/__ranges/common_view.h +++ libcxx/include/__ranges/common_view.h @@ -29,6 +29,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -133,4 +136,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_COMMON_VIEW_H Index: libcxx/include/__ranges/owning_view.h =================================================================== --- libcxx/include/__ranges/owning_view.h +++ libcxx/include/__ranges/owning_view.h @@ -27,6 +27,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -80,4 +83,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_OWNING_VIEW_H Index: libcxx/include/__ranges/range_adaptor.h =================================================================== --- libcxx/include/__ranges/range_adaptor.h +++ libcxx/include/__ranges/range_adaptor.h @@ -28,6 +28,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -76,4 +79,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_RANGE_ADAPTOR_H Index: libcxx/include/__ranges/subrange.h =================================================================== --- libcxx/include/__ranges/subrange.h +++ libcxx/include/__ranges/subrange.h @@ -46,6 +46,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -288,4 +291,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_SUBRANGE_H Index: libcxx/include/__stop_token/intrusive_shared_ptr.h =================================================================== --- libcxx/include/__stop_token/intrusive_shared_ptr.h +++ libcxx/include/__stop_token/intrusive_shared_ptr.h @@ -21,6 +21,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -125,4 +128,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___STOP_TOKEN_INTRUSIVE_SHARED_PTR_H 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/exception_guard.h =================================================================== --- libcxx/include/__utility/exception_guard.h +++ libcxx/include/__utility/exception_guard.h @@ -19,6 +19,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD // __exception_guard is a helper class for writing code with the strong exception guarantee. @@ -136,4 +139,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_TRANSACTION_H Index: libcxx/include/__utility/exchange.h =================================================================== --- libcxx/include/__utility/exchange.h +++ libcxx/include/__utility/exchange.h @@ -19,6 +19,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 14 @@ -35,4 +38,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_EXCHANGE_H 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/include/__utility/pair.h =================================================================== --- libcxx/include/__utility/pair.h +++ libcxx/include/__utility/pair.h @@ -55,6 +55,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -893,4 +896,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_PAIR_H Index: libcxx/include/__utility/swap.h =================================================================== --- libcxx/include/__utility/swap.h +++ libcxx/include/__utility/swap.h @@ -23,6 +23,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_CXX03_LANG @@ -51,4 +54,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_SWAP_H Index: libcxx/include/any =================================================================== --- libcxx/include/any +++ libcxx/include/any @@ -115,6 +115,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + namespace std { class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast { @@ -710,6 +713,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17 # include #endif Index: libcxx/include/experimental/propagate_const =================================================================== --- libcxx/include/experimental/propagate_const +++ libcxx/include/experimental/propagate_const @@ -135,6 +135,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + #if _LIBCPP_STD_VER >= 14 _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 @@ -594,6 +597,8 @@ #endif // _LIBCPP_STD_VER >= 14 +_LIBCPP_POP_MACROS + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include #endif Index: libcxx/include/optional =================================================================== --- libcxx/include/optional +++ libcxx/include/optional @@ -239,6 +239,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + namespace std // purposefully not using versioning namespace { @@ -1669,6 +1672,8 @@ #endif // _LIBCPP_STD_VER >= 17 +_LIBCPP_POP_MACROS + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include # include Index: libcxx/include/scoped_allocator =================================================================== --- libcxx/include/scoped_allocator +++ libcxx/include/scoped_allocator @@ -130,6 +130,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if !defined(_LIBCPP_CXX03_LANG) @@ -720,6 +723,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include # include Index: libcxx/include/tuple =================================================================== --- libcxx/include/tuple +++ libcxx/include/tuple @@ -270,6 +270,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_CXX03_LANG @@ -1856,6 +1859,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include # include Index: libcxx/test/libcxx/nasty_macros.gen.py =================================================================== --- libcxx/test/libcxx/nasty_macros.gen.py +++ libcxx/test/libcxx/nasty_macros.gen.py @@ -149,5 +149,10 @@ #define min NASTY_MACRO #define max NASTY_MACRO +// Test to make sure curses has no conflicting macros with the standard library +#define move NASTY_MACRO +#define erase NASTY_MACRO +#define refresh NASTY_MACRO + #include <{header}> """)