summaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-03-01 06:05:26 -0700
committerKarl Williamson <khw@cpan.org>2022-08-22 06:52:07 -0600
commitfaef259e0816784a2125b15dd8809ee275a43601 (patch)
treed9b3fe8e13a88102ae4c7a6f7814e8c47f89a719 /embed.h
parent3871c541ec107b9b83a3b7f01bb2021b1f49a376 (diff)
downloadperl-faef259e0816784a2125b15dd8809ee275a43601.tar.gz
locale.c: Return defaults for uncomputable langinfo items
Return the values from the C locale for nl_langinfo() items that aren't computable on this platform. If the platform has nl_langinfo(), then all of them are computable, but if not, some can't be computed, and others can be, but only if there are alternative methods available on the platform. As part of this commit, S_my_nl_langinfo() and S_save_to_buffer() are no longer used when USE_LOCALE is not defined, so don't compile them.
Diffstat (limited to 'embed.h')
-rw-r--r--embed.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/embed.h b/embed.h
index 3a97f0b3fd..37a95ef817 100644
--- a/embed.h
+++ b/embed.h
@@ -1495,7 +1495,9 @@
# endif
# if !(defined(HAS_NL_LANGINFO))
# if defined(PERL_IN_LOCALE_C)
+# if defined(USE_LOCALE)
#define my_nl_langinfo S_my_nl_langinfo
+# endif
# endif
# endif
# if !(defined(PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION))
@@ -1607,7 +1609,9 @@
# endif
# if defined(HAS_NL_LANGINFO)
# if defined(PERL_IN_LOCALE_C)
+# if defined(USE_LOCALE)
#define my_nl_langinfo S_my_nl_langinfo
+# endif
# endif
# endif
# if defined(HAS_PIPE)
@@ -1698,7 +1702,6 @@
# endif
# if defined(PERL_IN_LOCALE_C)
#define mortalized_pv_copy(a) S_mortalized_pv_copy(aTHX_ a)
-#define save_to_buffer S_save_to_buffer
# if defined(USE_LOCALE)
#define category_name S_category_name
#define get_category_index S_get_category_index
@@ -1707,6 +1710,7 @@
#define new_ctype(a) S_new_ctype(aTHX_ a)
#define new_numeric(a) S_new_numeric(aTHX_ a)
#define restore_switched_locale(a,b) S_restore_switched_locale(aTHX_ a,b)
+#define save_to_buffer S_save_to_buffer
#define set_numeric_radix(a) S_set_numeric_radix(aTHX_ a)
#define setlocale_failure_panic_i(a,b,c,d,e) S_setlocale_failure_panic_i(aTHX_ a,b,c,d,e)
#define stdize_locale(a,b,c,d,e) S_stdize_locale(aTHX_ a,b,c,d,e)