summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-11-26 17:15:16 -0700
committerKarl Williamson <khw@cpan.org>2022-12-07 09:13:37 -0700
commit525e8d06ae8a84702e984bf5485c417a73e49b47 (patch)
treec1041e14c34c343d0bdfa2546fbcb42b25c5dac3 /locale.c
parent3bc9d329f51e69a2d7aadbf45a655d11883a71c5 (diff)
downloadperl-525e8d06ae8a84702e984bf5485c417a73e49b47.tar.gz
locale.c: Prepare get_locale_string_utf8ness_i for no locales
This changes this function so that when compiled without using locales, it still works: returning that anything passed to it isn't UTF-8. This is trivailly true.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/locale.c b/locale.c
index b59210af75..befb9421ac 100644
--- a/locale.c
+++ b/locale.c
@@ -2949,13 +2949,25 @@ S_save_to_buffer(const char * string, const char **buf, Size_t *buf_size)
return *buf;
}
+#endif
+
STATIC utf8ness_t
S_get_locale_string_utf8ness_i(pTHX_ const char * string,
const locale_utf8ness_t known_utf8,
const char * locale,
const unsigned cat_index)
{
- PERL_ARGS_ASSERT_GET_LOCALE_STRING_UTF8NESS_I;
+
+#ifndef USE_LOCALE
+
+ return UTF8NESS_NO;
+ PERL_UNUSED_ARG(string);
+ PERL_UNUSED_ARG(known_utf8);
+ PERL_UNUSED_ARG(locale);
+ PERL_UNUSED_ARG(cat_index);
+
+#else
+
assert(cat_index <= NOMINAL_LC_ALL_INDEX);
/* Return to indicate if 'string' in the locale given by the input
@@ -3043,9 +3055,11 @@ S_get_locale_string_utf8ness_i(pTHX_ const char * string,
return UTF8NESS_YES;
# endif
+#endif
}
+#ifdef USE_LOCALE
# ifdef WIN32
bool