]> Savannah Git Hosting - gnulib.git/commitdiff
nl_langinfo: Fix compilation error on Android.
authorBruno Haible <bruno@clisp.org>
Mon, 14 May 2018 01:02:29 +0000 (03:02 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 14 May 2018 01:02:29 +0000 (03:02 +0200)
* lib/nl_langinfo.c (nl_langinfo): Define values for the items GROUPING,
INT_CURR_SYMBOL, etc. only if these items are defined.

ChangeLog
lib/nl_langinfo.c

index 5f77a64d597a43b9951107a3c205a519ddd18453..24fd4da80e6883aac66605b7135f0aee988b062a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-13  Bruno Haible  <bruno@clisp.org>
+
+       nl_langinfo: Fix compilation error on Android.
+       * lib/nl_langinfo.c (nl_langinfo): Define values for the items GROUPING,
+       INT_CURR_SYMBOL, etc. only if these items are defined.
+
 2018-05-13  Bruno Haible  <bruno@clisp.org>
 
        truncate: Fix compilation error on Android.
index 90b26a2498dedacf7e4f5eeb258e448d56fb9f60..ea26730ecc4aa9e5e4f7029f75c9dd7b70f85795 100644 (file)
@@ -191,8 +191,10 @@ nl_langinfo (nl_item item)
       return localeconv () ->decimal_point;
     case THOUSEP:
       return localeconv () ->thousands_sep;
+# ifdef GROUPING
     case GROUPING:
       return localeconv () ->grouping;
+# endif
     /* nl_langinfo items of the LC_TIME category.
        TODO: Really use the locale.  */
     case D_T_FMT:
@@ -320,6 +322,7 @@ nl_langinfo (nl_item item)
     /* nl_langinfo items of the LC_MONETARY category.  */
     case CRNCYSTR:
       return localeconv () ->currency_symbol;
+# ifdef INT_CURR_SYMBOL
     case INT_CURR_SYMBOL:
       return localeconv () ->int_curr_symbol;
     case MON_DECIMAL_POINT:
@@ -348,6 +351,7 @@ nl_langinfo (nl_item item)
       return & localeconv () ->p_sign_posn;
     case N_SIGN_POSN:
       return & localeconv () ->n_sign_posn;
+# endif
     /* nl_langinfo items of the LC_MESSAGES category
        TODO: Really use the locale. */
     case YESEXPR: