diff --git a/embed.fnc b/embed.fnc index 4851d8608808..a1c1d979db57 100644 --- a/embed.fnc +++ b/embed.fnc @@ -4324,12 +4324,6 @@ op |SV * |hfree_next_entry \ |NN STRLEN *indexp #endif #if defined(PERL_IN_LOCALE_C) -S |utf8ness_t|get_locale_string_utf8ness_i \ - |NULLOK const char *string \ - |const locale_utf8ness_t known_utf8 \ - |NULLOK const char *locale \ - |const unsigned cat_index -S |bool |is_locale_utf8 |NN const char *locale # if defined(HAS_LOCALECONV) S |HV * |my_localeconv |const int item S |void |populate_hash_from_localeconv \ @@ -4339,6 +4333,15 @@ S |void |populate_hash_from_localeconv \ |NN const lconv_offset_t *strings[2] \ |NULLOK const lconv_offset_t *integers # endif +# if defined(HAS_LOCALECONV) || defined(HAS_SOME_LANGINFO) || \ + defined(USE_LOCALE) +S |utf8ness_t|get_locale_string_utf8ness_i \ + |NULLOK const char *string \ + |const locale_utf8ness_t known_utf8 \ + |NULLOK const char *locale \ + |const unsigned cat_index +S |bool |is_locale_utf8 |NN const char *locale +# endif # if defined(USE_LOCALE) S |const char *|calculate_LC_ALL_string \ |NULLOK const char **category_locales_list \ diff --git a/embed.h b/embed.h index 268ac489b4ab..cb0375b1044f 100644 --- a/embed.h +++ b/embed.h @@ -1267,12 +1267,15 @@ # endif # endif /* defined(PERL_IN_HV_C) */ # if defined(PERL_IN_LOCALE_C) -# define get_locale_string_utf8ness_i(a,b,c,d) S_get_locale_string_utf8ness_i(aTHX_ a,b,c,d) -# define is_locale_utf8(a) S_is_locale_utf8(aTHX_ a) # if defined(HAS_LOCALECONV) # define my_localeconv(a) S_my_localeconv(aTHX_ a) # define populate_hash_from_localeconv(a,b,c,d,e) S_populate_hash_from_localeconv(aTHX_ a,b,c,d,e) # endif +# if defined(HAS_LOCALECONV) || defined(HAS_SOME_LANGINFO) || \ + defined(USE_LOCALE) +# define get_locale_string_utf8ness_i(a,b,c,d) S_get_locale_string_utf8ness_i(aTHX_ a,b,c,d) +# define is_locale_utf8(a) S_is_locale_utf8(aTHX_ a) +# endif # if defined(USE_LOCALE) # define calculate_LC_ALL_string(a,b,c,d) S_calculate_LC_ALL_string(aTHX_ a,b,c,d) # define get_category_index_helper(a,b,c) S_get_category_index_helper(aTHX_ a,b,c) diff --git a/locale.c b/locale.c index ffcb8dc6a175..b6e6f54187e8 100644 --- a/locale.c +++ b/locale.c @@ -4929,6 +4929,8 @@ Perl_setlocale(const int category, const char * locale) } +#if defined(USE_LOCALE) || defined(HAS_SOME_LANGINFO) || defined(HAS_LOCALECONV) + STATIC utf8ness_t S_get_locale_string_utf8ness_i(pTHX_ const char * string, const locale_utf8ness_t known_utf8, @@ -5040,8 +5042,8 @@ S_get_locale_string_utf8ness_i(pTHX_ const char * string, return UTF8NESS_YES; +# endif # endif -#endif } @@ -5093,6 +5095,7 @@ S_is_locale_utf8(pTHX_ const char * locale) } +#endif #ifdef USE_LOCALE STATIC const char * diff --git a/proto.h b/proto.h index 38023eee6e49..f98c6a5aaef0 100644 --- a/proto.h +++ b/proto.h @@ -6955,15 +6955,6 @@ Perl_hfree_next_entry(pTHX_ HV *hv, STRLEN *indexp) #endif #if defined(PERL_IN_LOCALE_C) -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); -# define PERL_ARGS_ASSERT_GET_LOCALE_STRING_UTF8NESS_I - -STATIC bool -S_is_locale_utf8(pTHX_ const char *locale); -# define PERL_ARGS_ASSERT_IS_LOCALE_UTF8 \ - assert(locale) - # if defined(HAS_LOCALECONV) STATIC HV * S_my_localeconv(pTHX_ const int item); @@ -6975,6 +6966,19 @@ S_populate_hash_from_localeconv(pTHX_ HV *hv, const char *locale, const U32 whic assert(hv); assert(locale); assert(strings) # endif /* defined(HAS_LOCALECONV) */ +# if defined(HAS_LOCALECONV) || defined(HAS_SOME_LANGINFO) || \ + defined(USE_LOCALE) +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); +# define PERL_ARGS_ASSERT_GET_LOCALE_STRING_UTF8NESS_I + +STATIC bool +S_is_locale_utf8(pTHX_ const char *locale); +# define PERL_ARGS_ASSERT_IS_LOCALE_UTF8 \ + assert(locale) + +# endif /* defined(HAS_LOCALECONV) || defined(HAS_SOME_LANGINFO) || + defined(USE_LOCALE) */ # if defined(USE_LOCALE) STATIC const char * S_calculate_LC_ALL_string(pTHX_ const char **category_locales_list, const calc_LC_ALL_format format, const bool return_in_setlocale_buf, const line_t caller_line);