[libc++] Fix two fr_FR locale tests on FreeBSD
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Thu, 26 Nov 2020 14:47:31 +0000 (14:47 +0000)
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Thu, 26 Nov 2020 16:09:51 +0000 (16:09 +0000)
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

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

index 862bc9018cbf9e3e62836652836f17f7fc947183..f7041f96675d19aad0f92c1f2c3086fc87d8e066 100644 (file)
@@ -49,14 +49,15 @@ public:
         : 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;
index e35bc2573d8cdce1debd6bdd87c4fe32f9568108..837f542a9e62124a4ec123e1013fc0743f8f3c4b 100644 (file)
@@ -49,14 +49,15 @@ public:
         : 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;