summaryrefslogtreecommitdiff
path: root/proto.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 /proto.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 'proto.h')
-rw-r--r--proto.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/proto.h b/proto.h
index 9f6d0df7ff..d35e295fba 100644
--- a/proto.h
+++ b/proto.h
@@ -49,6 +49,7 @@ PERL_CALLCONV int Perl_PerlLIO_open_cloexec(pTHX_ const char *file, int flag)
#define PERL_ARGS_ASSERT_PERLLIO_OPEN_CLOEXEC \
assert(file)
+PERL_CALLCONV const char* Perl_setlocale(const int category, const char* locale);
PERL_CALLCONV void* Perl_Slab_Alloc(pTHX_ size_t sz)
__attribute__warn_unused_result__;
@@ -2946,7 +2947,6 @@ PERL_CALLCONV void Perl_setfd_cloexec_for_nonsysfd(pTHX_ int fd);
PERL_CALLCONV void Perl_setfd_cloexec_or_inhexec_by_sysfdness(pTHX_ int fd);
PERL_CALLCONV void Perl_setfd_inhexec(int fd);
PERL_CALLCONV void Perl_setfd_inhexec_for_sysfd(pTHX_ int fd);
-PERL_CALLCONV char* Perl_setlocale(int category, const char* locale);
PERL_CALLCONV HEK* Perl_share_hek(pTHX_ const char* str, SSize_t len, U32 hash);
#define PERL_ARGS_ASSERT_SHARE_HEK \
assert(str)