summaryrefslogtreecommitdiff
path: root/intrpvar.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-02-16 14:13:19 -0700
committerKarl Williamson <khw@cpan.org>2018-02-18 13:12:29 -0700
commit9aac5db886d0626569524a0be2a769ebb8078307 (patch)
tree1fa1184f9ec9e92da6968cf49bb34ec6c2a1d367 /intrpvar.h
parentc5dd0eb10ca118d8904fd359a7c626be58928d1b (diff)
downloadperl-9aac5db886d0626569524a0be2a769ebb8078307.tar.gz
Add Perl_setlocale()
khw could not find any modules on CPAN that correctly use the C library function setlocale(). (The very few that do try, do not use it correctly, looking at the return value incorrectly, so they are broken.) This analysis does not include modules that call non-Perl libaries that may call setlocale(). And, a future commit will render the setlocale() function useless in some configurations on some platforms. So this commit adds Perl_setlocale(), for XS code to call, and which is always effective, but it should not be used to alter the locale except on platforms where the predefined variable ${^SAFE_LOCALES} evaluates to 1. This function is also what POSIX::setlocale() calls to do the real work.
Diffstat (limited to 'intrpvar.h')
-rw-r--r--intrpvar.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/intrpvar.h b/intrpvar.h
index 51fb16bf6b..884fa87dc6 100644
--- a/intrpvar.h
+++ b/intrpvar.h
@@ -590,6 +590,8 @@ PERLVARI(I, collation_standard, bool, TRUE)
PERLVARI(I, langinfo_buf, char *, NULL)
PERLVARI(I, langinfo_bufsize, Size_t, 0)
+PERLVARI(I, setlocale_buf, char *, NULL)
+PERLVARI(I, setlocale_bufsize, Size_t, 0)
#ifdef PERL_SAWAMPERSAND
PERLVAR(I, sawampersand, U8) /* must save all match strings */