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