Commit d2b02310 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-29240: Don't define decode_locale() on macOS (#4895)

Don't define decode_locale() nor encode_locale() on macOS or Android.
parent 6693d7af
...@@ -249,6 +249,7 @@ decode_ascii_surrogateescape(const char *arg, size_t *size) ...@@ -249,6 +249,7 @@ decode_ascii_surrogateescape(const char *arg, size_t *size)
} }
#endif #endif
#if !defined(__APPLE__) && !defined(__ANDROID__)
static wchar_t* static wchar_t*
decode_locale(const char* arg, size_t *size) decode_locale(const char* arg, size_t *size)
{ {
...@@ -364,6 +365,7 @@ oom: ...@@ -364,6 +365,7 @@ oom:
} }
return NULL; return NULL;
} }
#endif
/* Decode a byte string from the locale encoding with the /* Decode a byte string from the locale encoding with the
...@@ -453,6 +455,7 @@ _Py_EncodeLocaleUTF8(const wchar_t *text, size_t *error_pos) ...@@ -453,6 +455,7 @@ _Py_EncodeLocaleUTF8(const wchar_t *text, size_t *error_pos)
return cpath; return cpath;
} }
#if !defined(__APPLE__) && !defined(__ANDROID__)
static char* static char*
encode_locale(const wchar_t *text, size_t *error_pos) encode_locale(const wchar_t *text, size_t *error_pos)
{ {
...@@ -516,6 +519,7 @@ encode_locale(const wchar_t *text, size_t *error_pos) ...@@ -516,6 +519,7 @@ encode_locale(const wchar_t *text, size_t *error_pos)
} }
return result; return result;
} }
#endif
/* Encode a wide character string to the locale encoding with the /* Encode a wide character string to the locale encoding with the
surrogateescape error handler: surrogate characters in the range surrogateescape error handler: surrogate characters in the range
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment