[libcxx-commits] [libcxx] e70887d - [libc++][test] Don't use _LIBCPP macros.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 26 08:42:17 PDT 2022
Author: Mark de Wever
Date: 2022-10-26T17:42:11+02:00
New Revision: e70887ddcfdd1a84502a4ef66124d4cc04dd6735
URL: https://github.com/llvm/llvm-project/commit/e70887ddcfdd1a84502a4ef66124d4cc04dd6735
DIFF: https://github.com/llvm/llvm-project/commit/e70887ddcfdd1a84502a4ef66124d4cc04dd6735.diff
LOG: [libc++][test] Don't use _LIBCPP macros.
This was discovered by @ldionne.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D136709
Added:
Modified:
libcxx/test/support/test_format_context.h
Removed:
################################################################################
diff --git a/libcxx/test/support/test_format_context.h b/libcxx/test/support/test_format_context.h
index 37aad71ce169a..d7d38b5aceca6 100644
--- a/libcxx/test/support/test_format_context.h
+++ b/libcxx/test/support/test_format_context.h
@@ -32,11 +32,11 @@
#include <format>
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
-#include <locale>
+#ifndef TEST_HAS_NO_LOCALIZATION
+# include <locale>
#endif
-#if defined(_LIBCPP_VERSION)
+#ifdef _LIBCPP_VERSION
/** Creates a std::basic_format_context as-if the formatting function takes no locale. */
template <class OutIt, class CharT>
@@ -46,7 +46,7 @@ std::basic_format_context<OutIt, CharT> test_format_context_create(
return std::__format_context_create(std::move(out_it), args);
}
-#ifndef _LIBCPP_HAS_NO_LOCALIZATION
+# ifndef TEST_HAS_NO_LOCALIZATION
/** Creates a std::basic_format_context as-if the formatting function takes locale. */
template <class OutIt, class CharT>
std::basic_format_context<OutIt, CharT> test_format_context_create(
@@ -55,10 +55,9 @@ std::basic_format_context<OutIt, CharT> test_format_context_create(
std::locale loc) {
return std::__format_context_create(std::move(out_it), args, std::move(loc));
}
-#endif
-#else
-#error \
- "Please create a vendor specific version of the test functions and file a review at https://reviews.llvm.org/"
-#endif
+# endif // TEST_HAS_NO_LOCALIZATION
+#else // _LIBCPP_VERSION
+# error "Please create a vendor specific version of the test functions and file a review at https://reviews.llvm.org/"
+#endif // _LIBCPP_VERSION
#endif // SUPPORT_TEST_FORMAT_CONTEXT_HPP
More information about the libcxx-commits
mailing list