Skip to content

Commit 0b20d0a

Browse files
committed
[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
1 parent 8562d2c commit 0b20d0a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ class my_facetw
4949
: Fw(refs) {}
5050
};
5151

52-
5352
// GLIBC 2.27 and newer use U2027 (narrow non-breaking space) as a thousands sep.
5453
// this function converts the spaces in string inputs to that character if need
55-
// be.
54+
// be. FreeBSD's locale data also uses U2027 since 2018.
5655
static std::wstring convert_thousands_sep(std::wstring const& in) {
56+
#if defined(_CS_GNU_LIBC_VERSION) || defined(__FreeBSD__)
5757
#if defined(_CS_GNU_LIBC_VERSION)
5858
if (glibc_version_less_than("2.27"))
5959
return in;
60+
#endif
6061
std::wstring out;
6162
unsigned I = 0;
6263
bool seen_decimal = false;

libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ class my_facetw
4949
: Fw(refs) {}
5050
};
5151

52-
5352
// GLIBC 2.27 and newer use U2027 (narrow non-breaking space) as a thousands sep.
5453
// this function converts the spaces in string inputs to that character if need
55-
// be.
54+
// be. FreeBSD's locale data also uses U2027 since 2018.
5655
static std::wstring convert_thousands_sep(std::wstring const& in) {
56+
#if defined(_CS_GNU_LIBC_VERSION) || defined(__FreeBSD__)
5757
#if defined(_CS_GNU_LIBC_VERSION)
5858
if (glibc_version_less_than("2.27"))
5959
return in;
60+
#endif
6061
std::wstring out;
6162
unsigned I = 0;
6263
bool seen_num_start = false;

0 commit comments

Comments
 (0)