diff --git a/intrpvar.h b/intrpvar.h index f08de2f0d078..49d0c7872947 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -748,18 +748,12 @@ PERLVAR(I, padix_floor, PADOFFSET) /* how low may inner block reset padix */ #if defined(USE_POSIX_2008_LOCALE) && defined(MULTIPLICITY) PERLVARI(I, cur_locale_obj, locale_t, NULL) #endif -#ifdef USE_PL_CURLOCALES /* This is the most number of categories we've encountered so far on any * platform, doesn't include LC_ALL */ PERLVARA(I, curlocales, 12, const char *) - -#endif -#ifdef USE_PL_CUR_LC_ALL - PERLVARI(I, cur_LC_ALL, const char *, NULL) -#endif #ifdef USE_LOCALE_COLLATE /* The emory needed to store the collxfrm transformation of a string with diff --git a/makedef.pl b/makedef.pl index c8b34eba5612..080bff336025 100644 --- a/makedef.pl +++ b/makedef.pl @@ -169,7 +169,11 @@ BEGIN } } -if ($define{USE_POSIX_2008_LOCALE} && $define{HAS_QUERYLOCALE}) +if ( $define{USE_POSIX_2008_LOCALE} + && ( $define{HAS_QUERYLOCALE} + || ( $Config{cppsymbols} =~ /__GLIBC__/ + && $define{HAS_NL_LANGINFO_L} + && ! $define{SETLOCALE_ACCEPTS_ANY_LOCALE_NAME}))) { $define{USE_QUERYLOCALE} = 1; diff --git a/perl.h b/perl.h index 4ef161db95b4..4f7b83f5d07e 100644 --- a/perl.h +++ b/perl.h @@ -1287,14 +1287,13 @@ violations are fatal. # endif # include "perl_langinfo.h" /* Needed for _NL_LOCALE_NAME */ - # ifdef USE_POSIX_2008_LOCALE + # if defined(HAS_QUERYLOCALE) \ /* Use querylocale if has it, or has the glibc internal \ - * undocumented equivalent. */ \ + * undocumented equivalent (if not forbidden). */ \ || ( defined(_NL_LOCALE_NAME) \ - /* And asked for */ \ - && defined(USE_NL_LOCALE_NAME) \ + && ! defined(NO_USE_NL_LOCALE_NAME) \ /* nl_langinfo_l almost certainly will exist on systems that \ * have _NL_LOCALE_NAME, so there is nothing lost by \ * requiring it instead of also allowing plain nl_langinfo(). \