diff --git a/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.pass.cpp --- a/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.pass.cpp @@ -18,8 +18,10 @@ #include #include // for nanoseconds -#ifndef _LIBCPP_HAS_NO_THREADS -# include // for thread_id +#include "test_macros.h" + +#ifndef TEST_HAS_NO_THREADS +# include // for thread_id #endif struct TriviallyCopyable { @@ -35,7 +37,7 @@ int main(int, char**) { test(TriviallyCopyable(42)); test(std::chrono::nanoseconds(2)); -#ifndef _LIBCPP_HAS_NO_THREADS +#ifndef TEST_HAS_NO_THREADS test(std::this_thread::get_id()); #endif diff --git a/libcxx/test/std/atomics/types.pass.cpp b/libcxx/test/std/atomics/types.pass.cpp --- a/libcxx/test/std/atomics/types.pass.cpp +++ b/libcxx/test/std/atomics/types.pass.cpp @@ -22,12 +22,12 @@ #include #include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif - #include "test_macros.h" +#ifndef TEST_HAS_NO_THREADS +# include +#endif + template struct test_atomic { @@ -167,7 +167,7 @@ test(); #endif -#ifndef _LIBCPP_HAS_NO_THREADS +#ifndef TEST_HAS_NO_THREADS test(); #endif test(); diff --git a/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp --- a/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp +++ b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp @@ -26,8 +26,10 @@ #include #include -#ifndef _LIBCPP_HAS_NO_THREADS -# include +#include "test_macros.h" + +#ifndef TEST_HAS_NO_THREADS +# include #endif #include "compare_types.h" @@ -1058,7 +1060,7 @@ static_assert( !check_equality_comparable_with, std::vector >()); -#ifndef _LIBCPP_HAS_NO_THREADS +#ifndef TEST_HAS_NO_THREADS static_assert(!check_equality_comparable_with, std::lock_guard >()); static_assert(!check_equality_comparable_with, diff --git a/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp --- a/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp +++ b/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp @@ -22,8 +22,10 @@ #include #include -#ifndef _LIBCPP_HAS_NO_THREADS -# include +#include "test_macros.h" + +#ifndef TEST_HAS_NO_THREADS +# include #endif #include "type_classification/moveconstructible.h" diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp @@ -36,9 +36,6 @@ #include #include #include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif #include #include #include @@ -51,6 +48,9 @@ #ifndef TEST_HAS_NO_LOCALIZATION # include #endif +#ifndef TEST_HAS_NO_THREADS +# include +#endif // Validate default template argument. static_assert(std::same_as, std::formatter>); @@ -217,7 +217,7 @@ #ifndef TEST_HAS_NO_LOCALIZATION assert_formatter_is_disabled, CharT>(); #endif -#ifndef _LIBCPP_HAS_NO_THREADS +#ifndef TEST_HAS_NO_THREADS assert_formatter_is_disabled(); #endif assert_formatter_is_disabled, CharT>(); diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -384,6 +384,10 @@ # define TEST_HAS_NO_CHAR8_T #endif +#if defined(_LIBCPP_HAS_NO_THREADS) +# define TEST_HAS_NO_THREADS +#endif + #if defined(__GNUC__) #pragma GCC diagnostic pop #endif