summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-12-16 10:56:36 -0700
committerKarl Williamson <khw@cpan.org>2022-06-19 13:29:35 -0600
commit9b271b938aa912acb412cc7d05bf7a460ef1ddf0 (patch)
tree31590a28cbfadea7b6d0d22817d3a7a02596f7c8
parenta683a66af6c3842318beaa422f943ea8613f20f3 (diff)
downloadperl-9b271b938aa912acb412cc7d05bf7a460ef1ddf0.tar.gz
locale.c: Generalize certain Win32 calls
The old versions were windows-specific; the changes use a more generic macro that currently expands to the same thing, but future commits will change that.
-rw-r--r--locale.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/locale.c b/locale.c
index b8ea022ef0..1a84012d7a 100644
--- a/locale.c
+++ b/locale.c
@@ -2539,7 +2539,7 @@ S_my_nl_langinfo(const int item, bool toggle)
const char * p;
const char * first;
Size_t offset = 0;
- const char * name = porcelain_setlocale(LC_CTYPE, NULL);
+ const char * name = querylocale_c(LC_CTYPE);
if (isNAME_C_OR_POSIX(name)) {
return "ANSI_X3.4-1968";
@@ -2602,10 +2602,10 @@ S_my_nl_langinfo(const int item, bool toggle)
* We have to use LC_ALL instead of LC_MONETARY because of
* another bug in Windows */
- save_thread = savepv(porcelain_setlocale(LC_ALL, NULL));
+ save_thread = savepv(querylocale_c(LC_ALL));
_configthreadlocale(_DISABLE_PER_THREAD_LOCALE);
- save_global= savepv(porcelain_setlocale(LC_ALL, NULL));
- porcelain_setlocale(LC_ALL, save_thread);
+ save_global= savepv(querylocale_c(LC_ALL));
+ do_setlocale_c(LC_ALL, save_thread);
# endif
@@ -2637,9 +2637,9 @@ S_my_nl_langinfo(const int item, bool toggle)
# ifdef TS_W32_BROKEN_LOCALECONV
- porcelain_setlocale(LC_ALL, save_global);
+ do_setlocale_c(LC_ALL, save_global);
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
- porcelain_setlocale(LC_ALL, save_thread);
+ do_setlocale_c(LC_ALL, save_thread);
Safefree(save_global);
Safefree(save_thread);
@@ -2728,10 +2728,10 @@ S_my_nl_langinfo(const int item, bool toggle)
/* This should only be for the thousands separator. A
* different work around would be to use GetNumberFormat on a
* known value and parse the result to find the separator */
- save_thread = savepv(porcelain_setlocale(LC_ALL, NULL));
+ save_thread = savepv(querylocale_c(LC_ALL));
_configthreadlocale(_DISABLE_PER_THREAD_LOCALE);
- save_global = savepv(porcelain_setlocale(LC_ALL, NULL));
- porcelain_setlocale(LC_ALL, save_thread);
+ save_global = savepv(querylocale_c(LC_ALL));
+ do_setlocale_c(LC_ALL, save_thread);
# if 0
/* This is the start of code that for broken Windows replaces
* the above and below code, and instead calls
@@ -2766,9 +2766,9 @@ S_my_nl_langinfo(const int item, bool toggle)
# ifdef TS_W32_BROKEN_LOCALECONV
- porcelain_setlocale(LC_ALL, save_global);
+ do_setlocale_c(LC_ALL, save_global);
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
- porcelain_setlocale(LC_ALL, save_thread);
+ do_setlocale_c(LC_ALL, save_thread);
Safefree(save_global);
Safefree(save_thread);