Skip to content

Commit

Permalink
locale.c: Compile utf8ness on platforms that need it
Browse files Browse the repository at this point in the history
These two functions need to be compiled on certain other platforms than
what was happening.
  • Loading branch information
khwilliamson committed May 12, 2023
1 parent baebb43 commit 8cddc97
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
15 changes: 9 additions & 6 deletions embed.fnc
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
7 changes: 5 additions & 2 deletions embed.h
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion locale.c
Expand Up @@ -4790,6 +4790,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,
Expand Down Expand Up @@ -4901,8 +4903,8 @@ S_get_locale_string_utf8ness_i(pTHX_ const char * string,

return UTF8NESS_YES;

# endif
# endif
#endif

}

Expand Down Expand Up @@ -4954,6 +4956,7 @@ S_is_locale_utf8(pTHX_ const char * locale)

}

#endif
#ifdef USE_LOCALE

STATIC const char *
Expand Down
22 changes: 13 additions & 9 deletions proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8cddc97

Please sign in to comment.