diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 0fab00952593..a3b0fffbe0e0 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -2138,7 +2138,7 @@ localeconv() #else struct lconv *lcbuf; # if defined(USE_ITHREADS) \ - && defined(HAS_POSIX_2008_LOCALE) \ + && defined(USE_POSIX_2008_LOCALE) \ && defined(HAS_LOCALECONV_L) /* Prefer this thread-safe version */ bool do_free = FALSE; locale_t cur = NULL; @@ -2166,7 +2166,7 @@ localeconv() RETVAL = newHV(); sv_2mortal((SV*)RETVAL); # if defined(USE_ITHREADS) \ - && defined(HAS_POSIX_2008_LOCALE) \ + && defined(USE_POSIX_2008_LOCALE) \ && defined(HAS_LOCALECONV_L) cur = uselocale((locale_t) 0); @@ -2247,7 +2247,7 @@ localeconv() } } # if defined(USE_ITHREADS) \ - && defined(HAS_POSIX_2008_LOCALE) \ + && defined(USE_POSIX_2008_LOCALE) \ && defined(HAS_LOCALECONV_L) if (do_free) { freelocale(cur); diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm index 08986d26577d..8305c3014a60 100644 --- a/ext/POSIX/lib/POSIX.pm +++ b/ext/POSIX/lib/POSIX.pm @@ -4,7 +4,7 @@ use warnings; our ($AUTOLOAD, %SIGRT); -our $VERSION = '1.97'; +our $VERSION = '1.98'; require XSLoader; diff --git a/intrpvar.h b/intrpvar.h index 5c49d31528a3..88162843cab6 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -805,7 +805,7 @@ PERLVARI(I, numeric_standard, int, TRUE) PERLVAR(I, numeric_name, char *) /* Name of current numeric locale */ PERLVAR(I, numeric_radix_sv, SV *) /* The radix separator if not '.' */ -# ifdef HAS_POSIX_2008_LOCALE +# ifdef USE_POSIX_2008_LOCALE PERLVARI(I, underlying_numeric_obj, locale_t, NULL) diff --git a/locale.c b/locale.c index e8c9dc3a9f6e..65d2a26272af 100644 --- a/locale.c +++ b/locale.c @@ -1166,7 +1166,7 @@ S_new_numeric(pTHX_ const char *newnum) PL_numeric_underlying_is_standard = PL_numeric_standard; -# ifdef HAS_POSIX_2008_LOCALE +# ifdef USE_POSIX_2008_LOCALE PL_underlying_numeric_obj = newlocale(LC_NUMERIC_MASK, PL_numeric_name, @@ -2290,7 +2290,7 @@ S_my_nl_langinfo(const int item, bool toggle) #if defined(HAS_NL_LANGINFO) /* nl_langinfo() is available. */ # if ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L) \ - || ! defined(HAS_POSIX_2008_LOCALE) + || ! defined(USE_POSIX_2008_LOCALE) /* Here, use plain nl_langinfo(), switching to the underlying LC_NUMERIC * for those items dependent on it. This must be copied to a buffer before @@ -5359,13 +5359,11 @@ Perl_thread_locale_term() { /* Called from a thread as it gets ready to terminate */ -#ifdef USE_THREAD_SAFE_LOCALE +#ifdef USE_POSIX_2008_LOCALE /* C starts the new thread in the global C locale. If we are thread-safe, * we want to not be in the global locale */ -# ifndef WIN32 - { /* Free up */ locale_t cur_obj = uselocale(LC_GLOBAL_LOCALE); if (cur_obj != LC_GLOBAL_LOCALE && cur_obj != PL_C_locale_obj) { @@ -5373,7 +5371,6 @@ Perl_thread_locale_term() } } -# endif #endif } diff --git a/makedef.pl b/makedef.pl index 75167c20ab11..72c48f7d90c1 100644 --- a/makedef.pl +++ b/makedef.pl @@ -415,16 +415,6 @@ sub readvar { ++$skip{$_} foreach qw( PL_C_locale_obj PL_curlocales - ); -} - -unless ( $define{'HAS_NEWLOCALE'} - && $define{'HAS_FREELOCALE'} - && $define{'HAS_USELOCALE'} - && ! $define{'NO_POSIX_2008_LOCALE'}) -{ - ++$skip{$_} foreach qw( - PL_C_locale_obj PL_underlying_numeric_obj ); } diff --git a/perl.c b/perl.c index 56f1268e41bd..240e144c053d 100644 --- a/perl.c +++ b/perl.c @@ -1117,7 +1117,7 @@ perl_destruct(pTHXx) PL_curlocales[i] = NULL; } #endif -#ifdef HAS_POSIX_2008_LOCALE +#ifdef USE_POSIX_2008_LOCALE { /* This also makes sure we aren't using a locale object that gets freed * below */ diff --git a/perl.h b/perl.h index 526321833d0d..276a15cd73fc 100644 --- a/perl.h +++ b/perl.h @@ -6711,14 +6711,14 @@ the plain locale pragma without a parameter (S>) is in effect. * separate mutexes for some of them, the only changes needed are here. * Define just the necessary macros. The compiler should then croak if the * #ifdef's in the code are incorrect */ -# if defined(HAS_LOCALECONV) && ( ! defined(HAS_POSIX_2008_LOCALE) \ +# if defined(HAS_LOCALECONV) && ( ! defined(USE_POSIX_2008_LOCALE) \ || ! defined(HAS_LOCALECONV_L) \ || defined(TS_W32_BROKEN_LOCALECONV)) # define LOCALECONV_LOCK LOCALE_LOCK_ # define LOCALECONV_UNLOCK LOCALE_UNLOCK_ # endif # if defined(HAS_NL_LANGINFO) && ( ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L) \ - || ! defined(HAS_POSIX_2008_LOCALE)) + || ! defined(USE_POSIX_2008_LOCALE)) # define NL_LANGINFO_LOCK LOCALE_LOCK_ # define NL_LANGINFO_UNLOCK LOCALE_UNLOCK_ # endif diff --git a/sv.c b/sv.c index e8373953954b..0adbb5d671b7 100644 --- a/sv.c +++ b/sv.c @@ -15663,7 +15663,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, PL_numeric_name = SAVEPV(proto_perl->Inumeric_name); PL_numeric_radix_sv = sv_dup_inc(proto_perl->Inumeric_radix_sv, param); -# if defined(HAS_POSIX_2008_LOCALE) +# if defined(USE_POSIX_2008_LOCALE) PL_underlying_numeric_obj = NULL; # endif #endif /* !USE_LOCALE_NUMERIC */