diff --git a/libcxx/test/support/filesystem_test_helper.h b/libcxx/test/support/filesystem_test_helper.h --- a/libcxx/test/support/filesystem_test_helper.h +++ b/libcxx/test/support/filesystem_test_helper.h @@ -31,8 +31,12 @@ # include #endif -_LIBCPP_PUSH_MACROS -#include <__undef_macros> +#ifdef _WIN32 +// If built without -DNOMINMAX, Windows system headers can pollute the +// namespace with min/max defines that break standard C++. +#undef min +#undef max +#endif namespace utils { #ifdef _WIN32 @@ -736,6 +740,4 @@ return fs::path(); } -_LIBCPP_POP_MACROS - #endif /* FILESYSTEM_TEST_HELPER_H */