diff --git a/configure b/configure index 61a4e00d1d..9c1e4bc12d 100755 --- a/configure +++ b/configure @@ -32907,12 +32907,9 @@ $as_echo "$as_me: WARNING: I18n code requires wxFile... disabled" >&2;} fi if test "$wxUSE_XLOCALE" = "yes" ; then - $as_echo "#define wxUSE_XLOCALE 1" >>confdefs.h - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete xlocale" >&5 -$as_echo_n "checking for complete xlocale... " >&6; } -if ${wx_cv_func_strtod_l+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for locale_t" >&5 +$as_echo_n "checking for locale_t... " >&6; } +if ${wx_cv_type_locale_t+:} false; then : $as_echo_n "(cached) " >&6 else @@ -32925,7 +32922,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include #include #include @@ -32941,9 +32937,9 @@ main () } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - wx_cv_func_strtod_l=yes + wx_cv_type_locale_t=yes else - wx_cv_func_strtod_l=no + wx_cv_type_locale_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -32955,12 +32951,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_strtod_l" >&5 -$as_echo "$wx_cv_func_strtod_l" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_type_locale_t" >&5 +$as_echo "$wx_cv_type_locale_t" >&6; } + + if test "$wx_cv_type_locale_t" = "yes" ; then + $as_echo "#define wxUSE_XLOCALE 1" >>confdefs.h + - if test "$wx_cv_func_strtod_l" = "yes" ; then $as_echo "#define HAVE_LOCALE_T 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No locale_t support, wxXLocale won't be available" >&5 +$as_echo "$as_me: WARNING: No locale_t support, wxXLocale won't be available" >&2;} fi fi diff --git a/configure.in b/configure.in index 7b20dff46f..c9a84bb3a6 100644 --- a/configure.in +++ b/configure.in @@ -5757,17 +5757,11 @@ if test "$wxUSE_INTL" = "yes" ; then fi if test "$wxUSE_XLOCALE" = "yes" ; then - AC_DEFINE(wxUSE_XLOCALE) - - dnl even if xlocale.h exists, it may not contain all that - dnl wx needs. check if strtod_l() really is available. - AC_CACHE_CHECK([for complete xlocale], - wx_cv_func_strtod_l, + AC_CACHE_CHECK([for locale_t], wx_cv_type_locale_t, [ AC_LANG_PUSH(C++) AC_TRY_COMPILE( [ - #include #include #include ], @@ -5775,16 +5769,20 @@ if test "$wxUSE_XLOCALE" = "yes" ; then locale_t t; strtod_l(NULL, NULL, t); ], - wx_cv_func_strtod_l=yes, - wx_cv_func_strtod_l=no + wx_cv_type_locale_t=yes, + wx_cv_type_locale_t=no ) AC_LANG_POP() ]) - if test "$wx_cv_func_strtod_l" = "yes" ; then + if test "$wx_cv_type_locale_t" = "yes" ; then + AC_DEFINE(wxUSE_XLOCALE) + dnl We don't test (just) for locale_t existence, but we still define dnl this symbol to avoid changing the existing code using it. AC_DEFINE(HAVE_LOCALE_T) + else + AC_MSG_WARN([No locale_t support, wxXLocale won't be available]) fi fi diff --git a/include/wx/xlocale.h b/include/wx/xlocale.h index 27493974d0..9ade3a99f4 100644 --- a/include/wx/xlocale.h +++ b/include/wx/xlocale.h @@ -41,7 +41,6 @@ #define wxXLOCALE_IDENT(name) _ ## name #elif defined(HAVE_LOCALE_T) #include - #include #include #include