From f4dfeae2241a04c2404c998467d43723bd88cb1c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 14 May 2018 03:02:29 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/nl_langinfo.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5f77a64d59..24fd4da80e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-05-13 Bruno Haible + + 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 truncate: Fix compilation error on Android. diff --git a/lib/nl_langinfo.c b/lib/nl_langinfo.c index 90b26a2498..ea26730ecc 100644 --- a/lib/nl_langinfo.c +++ b/lib/nl_langinfo.c @@ -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: -- 2.39.5