[libcxx-commits] [PATCH] D136709: [libc++][test] Don't use _LIBCPP macros.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 25 11:45:44 PDT 2022


Mordante created this revision.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This was discovered by @ldionne.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136709

Files:
  libcxx/test/support/test_format_context.h


Index: libcxx/test/support/test_format_context.h
===================================================================
--- libcxx/test/support/test_format_context.h
+++ 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 @@
   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::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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136709.470583.patch
Type: text/x-patch
Size: 1520 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221025/9c64d4b9/attachment.bin>


More information about the libcxx-commits mailing list