Skip to content

Commit

Permalink
[libc++] Fix two fr_FR locale tests on FreeBSD
Browse files Browse the repository at this point in the history
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
  • Loading branch information
arichardson committed Nov 26, 2020
1 parent 8562d2c commit 0b20d0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0b20d0a

Please sign in to comment.