]> Savannah Git Hosting - gnulib.git/commitdiff
localename: support Solaris 12 and illumos
authorPádraig Brady <P@draigBrady.com>
Thu, 29 Jan 2015 16:44:48 +0000 (16:44 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 30 Jan 2015 10:59:35 +0000 (10:59 +0000)
* lib/localename.c (gl_locale_name_thread_unsafe): call
getlocalename_l() on newer __sun platforms.
Reported by Alexander Pyhalov.
Fix suggested by Rich Burridge.

ChangeLog
lib/localename.c

index a218b4f1a94b5fa2af561217f2f8f243b651b11d..69e3425798067793a493e8277794f1dd301579d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-01-29  Pádraig Brady  <P@draigBrady.com>
+
+       localename: support Solaris 12 and illumos
+       * lib/localename.c (gl_locale_name_thread_unsafe): call
+       getlocalename_l() on newer __sun platforms.
+       Reported by Alexander Pyhalov.
+       Fix suggested by Rich Burridge.
+
 2015-01-29  Alexander Pyhalov  <alp@rsu.ru>
 
        locale: fix tests on illumos (trivial)
index 815171c2a26e68a657597c819f21eee2dbd66c15..c6f326e5bd2ae4b1ff095b09274f33ec4731529c 100644 (file)
 # if !defined IN_LIBINTL
 #  include "glthread/lock.h"
 # endif
+# if defined __sun
+/* Solaris >= 12.  */
+extern char * getlocalename_l(int, locale_t);
+# endif
 #endif
 
 #if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
@@ -2584,7 +2588,7 @@ get_lcid (const char *locale_name)
 #endif
 
 
-#if HAVE_USELOCALE /* glibc or Mac OS X */
+#if HAVE_USELOCALE /* glibc, Solaris >= 12 or Mac OS X */
 
 /* Simple hash set of strings.  We don't want to drag in lots of hash table
    code here.  */
@@ -2723,6 +2727,9 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
             return "";
           }
         return querylocale (mask, thread_locale);
+#  elif defined __sun
+        /* Solaris >= 12.  */
+        return getlocalename_l (category, thread_locale);
 #  endif
       }
   }