diff options
author | Karl Williamson <khw@cpan.org> | 2018-02-14 21:15:40 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-02-18 11:20:32 -0700 |
commit | f512d242c9d4638098e64ccb855ca371e916bd5a (patch) | |
tree | b791e97b54e265a01fc4efb6159d5f4df32849ee /mg.c | |
parent | b119c2beea90ac8d7c9a63881ec4c00357d2f309 (diff) | |
download | perl-f512d242c9d4638098e64ccb855ca371e916bd5a.tar.gz |
Add ${^SAFE_LOCALES}
This read-only variable returns a boolean as to whether it is safe to
use locales in this perl. Without threads it returns 1; when a future
commit adds thread-safe locale handling, it will also return 1 if that
is enabled.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1069,7 +1069,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) sv_setiv(sv, (IV)PL_perldb); break; case '\023': /* ^S */ - { + if (nextchar == '\0') { if (PL_parser && PL_parser->lex_state != LEX_NOTPARSING) SvOK_off(sv); else if (PL_in_eval) @@ -1077,6 +1077,18 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) else sv_setiv(sv, 0); } + else if (strEQ(remaining, "AFE_LOCALES")) { + +#if ! defined(USE_ITHREADS) || defined(USE_THREAD_SAFE_LOCALE) + + sv_setuv(sv, (UV) 1); + +#else + sv_setuv(sv, (UV) 0); + +#endif + + } break; case '\024': /* ^T */ if (nextchar == '\0') { |