Skip to content

Commit

Permalink
f XXX make fcns accessible to cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed May 6, 2021
1 parent a6dc654 commit 8eb49df
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions embed.fnc
Expand Up @@ -3267,6 +3267,8 @@ S |const char *|find_locale_from_environment|const unsigned int index
# endif
# ifdef WIN32
S |char* |win32_setlocale|int category|NULLOK const char* locale
pTC |wchar_t *|Win_utf8_string_to_wstring|NULLOK const char * utf8_string
pTC |char * |Win_wstring_to_utf8_string|NULLOK const wchar_t * wstring
# endif
# ifdef DEBUGGING
S |void |print_collxfrm_input_and_return \
Expand Down
8 changes: 8 additions & 0 deletions embed.h
Expand Up @@ -863,6 +863,14 @@
#define warn_nocontext Perl_warn_nocontext
#define warner_nocontext Perl_warner_nocontext
#endif
#if defined(PERL_IN_LOCALE_C)
# if defined(USE_LOCALE)
# if defined(WIN32)
#define Win_utf8_string_to_wstring Perl_Win_utf8_string_to_wstring
#define Win_wstring_to_utf8_string Perl_Win_wstring_to_utf8_string
# endif
# endif
#endif
#if defined(PERL_USE_3ARG_SIGHANDLER)
#define csighandler Perl_csighandler
#endif
Expand Down
10 changes: 4 additions & 6 deletions locale.c
Expand Up @@ -2270,9 +2270,8 @@ S_new_collate(pTHX_ const char *newcoll)

#ifdef WIN32

STATIC
wchar_t *
S_Win_utf8_string_to_wstring(const char * utf8_string)
Perl_Win_utf8_string_to_wstring(const char * utf8_string)
{
wchar_t *wstring;

Expand All @@ -2294,9 +2293,8 @@ S_Win_utf8_string_to_wstring(const char * utf8_string)
return wstring;
}

STATIC
char *
S_Win_wstring_to_utf8_string(const wchar_t * wstring)
Perl_Win_wstring_to_utf8_string(const wchar_t * wstring)
{
char *utf8_string;

Expand Down Expand Up @@ -2327,7 +2325,7 @@ S_wrap_wsetlocale(pTHX_ int category, const char *locale) {
char *result;

if (locale) {
wlocale = S_Win_utf8_string_to_wstring(locale);
wlocale = Win_utf8_string_to_wstring(locale);
if (! wlocale) {
return NULL;
}
Expand All @@ -2343,7 +2341,7 @@ S_wrap_wsetlocale(pTHX_ int category, const char *locale) {
return NULL;
}

result = S_Win_wstring_to_utf8_string(wresult);
result = Win_wstring_to_utf8_string(wresult);
SAVEFREEPV(result); /* is there something better we can do here? */

return result;
Expand Down
4 changes: 4 additions & 0 deletions proto.h
Expand Up @@ -5175,6 +5175,10 @@ STATIC const char * S_calculate_LC_ALL(pTHX_ const locale_t cur_obj);
#define PERL_ARGS_ASSERT_CALCULATE_LC_ALL
# endif
# if defined(WIN32)
PERL_CALLCONV wchar_t * Perl_Win_utf8_string_to_wstring(const char * utf8_string);
#define PERL_ARGS_ASSERT_WIN_UTF8_STRING_TO_WSTRING
PERL_CALLCONV char * Perl_Win_wstring_to_utf8_string(const wchar_t * wstring);
#define PERL_ARGS_ASSERT_WIN_WSTRING_TO_UTF8_STRING
STATIC char* S_win32_setlocale(pTHX_ int category, const char* locale);
#define PERL_ARGS_ASSERT_WIN32_SETLOCALE
# endif
Expand Down

0 comments on commit 8eb49df

Please sign in to comment.