bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] FreeBSD gl_locale_name_thread_unsafe implementation


From: Ed Maste
Subject: [PATCH] FreeBSD gl_locale_name_thread_unsafe implementation
Date: Thu, 13 Sep 2012 13:52:22 +0000
User-agent: Mutt/1.4.2.3i

The patch below adds an implementation of gl_locale_name_thread_unsafe
for FreeBSD.  With this change all of the gllib tests will pass on
FreeBSD HEAD.

--- a/lib/localename.c
+++ b/lib/localename.c
@@ -2617,6 +2617,34 @@ gl_locale_name_thread_unsafe (int category, const char 
*categoryname)
           name = thread_locale->__names[category];
         return name;
 #  endif
+#  if defined __FreeBSD__
+        int mask;
+
+        switch (category)
+          {
+            case LC_COLLATE:
+                mask = LC_COLLATE_MASK;
+                break;
+            case LC_CTYPE:
+                mask = LC_CTYPE_MASK;
+                break;
+            case LC_MESSAGES:
+                mask = LC_MESSAGES_MASK;
+                break;
+            case LC_MONETARY:
+                mask = LC_MONETARY_MASK;
+                break;
+            case LC_NUMERIC:
+                mask = LC_NUMERIC_MASK;
+                break;
+            case LC_TIME:
+                mask = LC_TIME_MASK;
+                break;
+            default:
+                return NULL;
+          }
+        return querylocale(mask, thread_locale);
+#  endif
 #  if defined __APPLE__ && defined __MACH__ /* Mac OS X */
         /* The locale name is found deep in an undocumented data structure.
            Since it's stored in a buffer of size 32 and newlocale() rejects




reply via email to

[Prev in Thread] Current Thread [Next in Thread]