summaryrefslogtreecommitdiff
path: root/Python/fileutils.c
diff options
context:
space:
mode:
authorNed Deily <nad@python.org>2016-12-16 16:04:25 -0500
committerNed Deily <nad@python.org>2016-12-16 16:04:25 -0500
commit3010e3c98be77771c5c02d7fb837f89082a778f7 (patch)
tree4e6d25e8a0b66833e5ff5c5c8eea9aa02ea1d21c /Python/fileutils.c
parent0cc235b9c8a2c540796c5cf4c59ab81ae15c61f1 (diff)
parent40ed436163059ecdbe4645eb7cb37bf0c9b1dd09 (diff)
downloadcpython-3010e3c98be77771c5c02d7fb837f89082a778f7.tar.gz
null merge additional 3.6.0rc1+ cherrypicks
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r--Python/fileutils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 6a32c42c80..e84d66e99a 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -20,7 +20,7 @@ extern int winerror_to_errno(int);
#include <fcntl.h>
#endif /* HAVE_FCNTL_H */
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__ANDROID__)
extern wchar_t* _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size);
#endif
@@ -273,7 +273,7 @@ decode_ascii_surrogateescape(const char *arg, size_t *size)
wchar_t*
Py_DecodeLocale(const char* arg, size_t *size)
{
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__ANDROID__)
wchar_t *wstr;
wstr = _Py_DecodeUTF8_surrogateescape(arg, strlen(arg));
if (size != NULL) {
@@ -406,7 +406,7 @@ oom:
if (size != NULL)
*size = (size_t)-1;
return NULL;
-#endif /* __APPLE__ */
+#endif /* __APPLE__ or __ANDROID__ */
}
/* Encode a wide character string to the locale encoding with the
@@ -424,7 +424,7 @@ oom:
char*
Py_EncodeLocale(const wchar_t *text, size_t *error_pos)
{
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__ANDROID__)
Py_ssize_t len;
PyObject *unicode, *bytes = NULL;
char *cpath;
@@ -522,7 +522,7 @@ Py_EncodeLocale(const wchar_t *text, size_t *error_pos)
bytes = result;
}
return result;
-#endif /* __APPLE__ */
+#endif /* __APPLE__ or __ANDROID__ */
}