bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH V2] localename: Implement gl_locale_name_thread_unsafe() for Android
@ 2015-02-16 23:05 Kevin Cernekee
  0 siblings, 0 replies; only message in thread
From: Kevin Cernekee @ 2015-02-16 23:05 UTC (permalink / raw
  To: eggert; +Cc: enh, bug-gnulib

* lib/localename.c: Android API level >= 21 supports two hardcoded
locales: C (POSIX) and C.UTF-8.  Distinguish them by checking
the internal __locale_t struct.
---
 ChangeLog        | 5 +++++
 lib/localename.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 9b84dac..58fd8ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -63,6 +63,11 @@
 	they will be able to create a file descriptor numbered
 	(getdtablesize()-1), and will fail if rlim_max > rlim_cur.
 
+	localename: Implement gl_locale_name_thread_unsafe() for Android
+	* lib/localename.c: Android API level >= 21 supports two hardcoded
+	locales: C (POSIX) and C.UTF-8.  Distinguish them by checking
+	the internal __locale_t struct.
+
 2015-02-11  Pádraig Brady  <P@draigBrady.com>
 
 	tests: avoid recent -Werror=unused-variable regression in test-locale
diff --git a/lib/localename.c b/lib/localename.c
index c6f326e..f3733eb 100644
--- a/lib/localename.c
+++ b/lib/localename.c
@@ -2730,6 +2730,8 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
 #  elif defined __sun
         /* Solaris >= 12.  */
         return getlocalename_l (category, thread_locale);
+#  elif defined __ANDROID__
+        return MB_CUR_MAX == 4 ? "C.UTF-8" : "C";
 #  endif
       }
   }
-- 
1.9.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-16 23:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-16 23:05 [PATCH V2] localename: Implement gl_locale_name_thread_unsafe() for Android Kevin Cernekee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).