[libcxx-commits] [libcxx] 0b20d0a - [libc++] Fix two fr_FR locale tests on FreeBSD
Alex Richardson via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Nov 26 08:10:57 PST 2020
Author: Alex Richardson
Date: 2020-11-26T16:09:51Z
New Revision: 0b20d0af3f0ac71a037479984813e0da95ea0ff9
URL: https://github.com/llvm/llvm-project/commit/0b20d0af3f0ac71a037479984813e0da95ea0ff9
DIFF: https://github.com/llvm/llvm-project/commit/0b20d0af3f0ac71a037479984813e0da95ea0ff9.diff
LOG: [libc++] Fix two fr_FR locale tests on FreeBSD
FreeBSD's locale data uses the same U+2027 separator as Glibc 2.27 and newer.
Reviewed By: #libc, emaste, ldionne
Differential Revision: https://reviews.llvm.org/D91165
Added:
Modified:
libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
Removed:
################################################################################
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 862bc9018cbf..f7041f96675d 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
@@ -49,14 +49,15 @@ class my_facetw
: Fw(refs) {}
};
-
// GLIBC 2.27 and newer use U2027 (narrow non-breaking space) as a thousands sep.
// this function converts the spaces in string inputs to that character if need
-// be.
+// be. FreeBSD's locale data also uses U2027 since 2018.
static std::wstring convert_thousands_sep(std::wstring const& in) {
+#if defined(_CS_GNU_LIBC_VERSION) || defined(__FreeBSD__)
#if defined(_CS_GNU_LIBC_VERSION)
if (glibc_version_less_than("2.27"))
return in;
+#endif
std::wstring out;
unsigned I = 0;
bool seen_decimal = false;
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 e35bc2573d8c..837f542a9e62 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
@@ -49,14 +49,15 @@ class my_facetw
: Fw(refs) {}
};
-
// GLIBC 2.27 and newer use U2027 (narrow non-breaking space) as a thousands sep.
// this function converts the spaces in string inputs to that character if need
-// be.
+// be. FreeBSD's locale data also uses U2027 since 2018.
static std::wstring convert_thousands_sep(std::wstring const& in) {
+#if defined(_CS_GNU_LIBC_VERSION) || defined(__FreeBSD__)
#if defined(_CS_GNU_LIBC_VERSION)
if (glibc_version_less_than("2.27"))
return in;
+#endif
std::wstring out;
unsigned I = 0;
bool seen_num_start = false;
More information about the libcxx-commits
mailing list