[PATCH] D34535: [libcxx] [test] Fix MSVC warning C4067 "unexpected tokens following preprocessor directive - expected a newline".

Stephan T. Lavavej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 22 14:31:38 PDT 2017


STL_MSFT created this revision.

[libcxx] [test] Fix MSVC warning C4067 "unexpected tokens following preprocessor directive - expected a newline".

Also fixes Clang/LLVM 4.0 (for Windows) error "function-like macro 'TEST_GLIBC_PREREQ' is not defined".


https://reviews.llvm.org/D34535

Files:
  test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp


Index: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
===================================================================
--- test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
+++ test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
@@ -117,7 +117,13 @@
         // GLIBC <= 2.23 uses currency_symbol="<U0440><U0443><U0431>"
         // GLIBC >= 2.24 uses currency_symbol="<U20BD>"
         // See also: http://www.fileformat.info/info/unicode/char/20bd/index.htm
-#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24)
+#if defined(TEST_GLIBC_PREREQ)
+    #if TEST_GLIBC_PREREQ(2, 24)
+        #define TEST_GLIBC_2_24_CURRENCY_SYMBOL
+    #endif
+#endif
+
+#if defined(TEST_GLIBC_2_24_CURRENCY_SYMBOL)
         assert(f.curr_symbol() == " \u20BD");
 #else
         assert(f.curr_symbol() == " \xD1\x80\xD1\x83\xD0\xB1");
@@ -129,7 +135,7 @@
     }
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
-#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24)
+#if defined(TEST_GLIBC_2_24_CURRENCY_SYMBOL)
         assert(f.curr_symbol() == L" \u20BD");
 #else
         assert(f.curr_symbol() == L" \x440\x443\x431");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34535.103640.patch
Type: text/x-patch
Size: 1279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170622/58892dd7/attachment.bin>


More information about the cfe-commits mailing list