diff options
author | Karl Williamson <khw@cpan.org> | 2021-02-11 12:33:23 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-08-09 18:05:59 -0600 |
commit | 827a4a051afa67d6b91304bc64744af3072038aa (patch) | |
tree | e7f1d7e1d38bd36e7bd230b54909efdb6f9f5217 /intrpvar.h | |
parent | c6efbad02ab04568fbee498752817f20f3124611 (diff) | |
download | perl-827a4a051afa67d6b91304bc64744af3072038aa.tar.gz |
locale.c: Add fcn to hide edge case undefined behavior
The POSIX 2008 API has an edge case in that the result of most of the
functions when called with a global (as opposed to a per-thread) locale
is undefined.
The duplocale() function is the exception which will create a per-thread
locale containing the values copied from the global one.
This commit just calls duplocale, if needed, and the caller need not
concern itself with this possibility
Diffstat (limited to 'intrpvar.h')
-rw-r--r-- | intrpvar.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/intrpvar.h b/intrpvar.h index d607e452dc..58e9ef9a23 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -825,6 +825,9 @@ PERLVAR(I, numeric_radix_sv, SV *) /* The radix separator if not '.' */ PERLVARI(I, underlying_numeric_obj, locale_t, NULL) #endif +#ifdef USE_POSIX_2008_LOCALE +PERLVARI(I, scratch_locale_obj, locale_t, 0) +#endif /* Array of signal handlers, indexed by signal number, through which the C signal handler dispatches. */ |