diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp index 7d1fee4d3c3f..bebc1f27bb34 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp @@ -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_sep(std::wstring const& in) { out.push_back(L'\u202F'); } return out; +#else + return in; #endif } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp index acad6e32fd1d..2b431dc529d8 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp @@ -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_sep(std::wstring const& in) { out.push_back(L'\u202F'); } return out; +#else + return in; #endif } diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp index 880d800c5725..ca8abf09b830 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp @@ -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' ';