[libcxx] r329149 - Fix undefined macro issue in locale tests; Try 2

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 3 21:48:27 PDT 2018


Author: ericwf
Date: Tue Apr  3 21:48:26 2018
New Revision: 329149

URL: http://llvm.org/viewvc/llvm-project?rev=329149&view=rev
Log:
Fix undefined macro issue in locale tests; Try 2

Modified:
    libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
    libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp

Modified: libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp?rev=329149&r1=329148&r2=329149&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp Tue Apr  3 21:48:26 2018
@@ -52,9 +52,10 @@ public:
 // this function converts the spaces in string inputs to that character if need
 // be.
 static std::wstring convert_thousands_sep(std::wstring const& in) {
-#if !defined(TEST_HAS_GLIBC) || !TEST_GLIBC_PREREQ(2,27)
-  return in;
-#else
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
+#if TEST_GLIBC_PREREQ(2,27)
   std::wstring out;
   unsigned I = 0;
   bool seen_decimal = false;
@@ -68,6 +69,8 @@ static std::wstring convert_thousands_se
     out.push_back(L'\u202F');
   }
   return out;
+#else
+  return in;
 #endif
 }
 

Modified: libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp?rev=329149&r1=329148&r2=329149&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp Tue Apr  3 21:48:26 2018
@@ -52,9 +52,10 @@ public:
 // this function converts the spaces in string inputs to that character if need
 // be.
 static std::wstring convert_thousands_sep(std::wstring const& in) {
-#if !defined(TEST_HAS_GLIBC) || !TEST_GLIBC_PREREQ(2,27)
-  return in;
-#else
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
+#if TEST_GLIBC_PREREQ(2,27)
   std::wstring out;
   unsigned I = 0;
   bool seen_num_start = false;
@@ -70,6 +71,8 @@ static std::wstring convert_thousands_se
     out.push_back(L'\u202F');
   }
   return out;
+#else
+  return in;
 #endif
 }
 

Modified: libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp?rev=329149&r1=329148&r2=329149&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp Tue Apr  3 21:48:26 2018
@@ -101,6 +101,9 @@ int main()
         assert(f.thousands_sep() == ' ');
     }
 // The below tests work around GLIBC's use of U202F as mon_thousands_sep.
+#ifndef TEST_GLIBC_PREREQ
+#define TEST_GLIBC_PREREQ(x, y) 0
+#endif
 #if defined(TEST_HAS_GLIBC) && TEST_GLIBC_PREREQ(2, 27)
     const wchar_t fr_sep = L'\u202F';
 #else
@@ -118,9 +121,6 @@ int main()
 // and U002E as mon_decimal_point.
 // TODO: Fix thousands_sep for 'char'.
 // related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006
-#ifndef TEST_GLIBC_PREREQ
-#define TEST_GLIBC_PREREQ(x, y) 0
-#endif
 #ifndef TEST_HAS_GLIBC
     const char sep = ' ';
     const wchar_t wsep = L' ';




More information about the cfe-commits mailing list