Skip to content

Commit 525e8d0

Browse files
committed
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.
1 parent 3bc9d32 commit 525e8d0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

locale.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2949,13 +2949,25 @@ S_save_to_buffer(const char * string, const char **buf, Size_t *buf_size)
29492949
return *buf;
29502950
}
29512951

2952+
#endif
2953+
29522954
STATIC utf8ness_t
29532955
S_get_locale_string_utf8ness_i(pTHX_ const char * string,
29542956
const locale_utf8ness_t known_utf8,
29552957
const char * locale,
29562958
const unsigned cat_index)
29572959
{
2958-
PERL_ARGS_ASSERT_GET_LOCALE_STRING_UTF8NESS_I;
2960+
2961+
#ifndef USE_LOCALE
2962+
2963+
return UTF8NESS_NO;
2964+
PERL_UNUSED_ARG(string);
2965+
PERL_UNUSED_ARG(known_utf8);
2966+
PERL_UNUSED_ARG(locale);
2967+
PERL_UNUSED_ARG(cat_index);
2968+
2969+
#else
2970+
29592971
assert(cat_index <= NOMINAL_LC_ALL_INDEX);
29602972

29612973
/* 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,
30433055
return UTF8NESS_YES;
30443056

30453057
# endif
3058+
#endif
30463059

30473060
}
30483061

3062+
#ifdef USE_LOCALE
30493063
# ifdef WIN32
30503064

30513065
bool

0 commit comments

Comments
 (0)