summaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-02-15 12:58:07 -0700
committerKarl Williamson <public@khwilliamson.com>2014-02-15 15:50:35 -0700
commitb385bb4ddcb252e69a1044d702646741e2e489fb (patch)
treeb8e382f127fa164b5d29c6833e2fcf534e28377d /embed.h
parent97dffe50643dd18f87b33b7ec6f8b55bbfd1fd74 (diff)
downloadperl-b385bb4ddcb252e69a1044d702646741e2e489fb.tar.gz
Emulate POSIX locale setting on Windows
Locale initialization and setting on Windows haven't been as described in perllocale for setting locales to "". This is because that tells Windows to use the system default locale, as set through the Control Panel, but on POSIX systems, it means to look at various environment variables. This commit creates a wrapper for setlocale, used only on Windows, that looks for the appropriate environment variables when called with a "" input locale. If none are found, it continues to use the system default locale.
Diffstat (limited to 'embed.h')
-rw-r--r--embed.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/embed.h b/embed.h
index d1224eb200..1075912504 100644
--- a/embed.h
+++ b/embed.h
@@ -849,6 +849,9 @@
#define PerlIO_unread(a,b,c) Perl_PerlIO_unread(aTHX_ a,b,c)
#define PerlIO_write(a,b,c) Perl_PerlIO_write(aTHX_ a,b,c)
#endif
+#if defined(WIN32)
+#define my_setlocale(a,b) Perl_my_setlocale(aTHX_ a,b)
+#endif
#if defined(WIN32) || defined(__SYMBIAN32__) || defined(VMS)
#define do_aspawn(a,b,c) Perl_do_aspawn(aTHX_ a,b,c)
#define do_spawn(a) Perl_do_spawn(aTHX_ a)