Added check for whether there is any useful information in

struct lconv. Android doesn't have anything there, despite
having locale.h, so it makes little sense to try to access
the nonexistent fields in GSLocale.m



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36632 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Ivan Vučica 2013-05-16 08:44:53 +00:00
parent e34b48653b
commit b2129096ab
3 changed files with 25 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2013-05-16 Ivan Vučica <ivan@vucica.net>
* Source/GSLocale.m:
* configure.ac:
Added check for whether there is any useful information in
struct lconv. Android doesn't have anything there, despite
having locale.h, so it makes little sense to try to access
the nonexistent fields in GSLocale.m
2013-05-16 Ivan Vučica <ivan@vucica.net>
* configure.ac:

View file

@ -46,7 +46,9 @@ GSSetLocale(int category, NSString *locale)
return nil;
}
#ifdef HAVE_LOCALE_H
#if defined(HAVE_LOCALE_H) && defined(HAVE_CURRENCY_SYMBOL_IN_LCONV)
/* There is little point in using locale.h if no useful information
is exposed through struct lconv. An example platform is Android. */
#include <locale.h>
#ifdef HAVE_LANGINFO_H

View file

@ -2099,6 +2099,19 @@ if test "x$ac_cv_have_pw_gecos_in_struct_passwd" = "xyes" ; then
[Define if you have pw_gecos field in struct passwd])
fi
AC_CACHE_CHECK([for currency_symbol field in struct lconv],
ac_cv_have_currency_symbol_in_struct_lconv, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <locale.h> ]],
[[ struct lconv l; l.currency_symbol = NULL; ]])],
[ ac_cv_have_currency_symbol_in_struct_lconv="yes" ],
[ ac_cv_have_currency_symbol_in_struct_lconv="no"
])
])
if test "x$ac_cv_have_currency_symbol_in_struct_lconv" = "xyes" ; then
AC_DEFINE([HAVE_CURRENCY_SYMBOL_IN_LCONV], [1],
[Define if you have currency_symbol field in struct lconv])
fi
#--------------------------------------------------------------------
# These two headers (functions) needed by Time.m
#--------------------------------------------------------------------