aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/fileutils.c4
-rw-r--r--Python/sysmodule.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 68d24bc6b93..95b64ed76fb 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -55,7 +55,9 @@ int _Py_open_cloexec_works = -1;
// mbstowcs() and mbrtowc() errors
static const size_t DECODE_ERROR = ((size_t)-1);
+#ifdef HAVE_MBRTOWC
static const size_t INCOMPLETE_CHARACTER = (size_t)-2;
+#endif
static int
@@ -129,6 +131,7 @@ is_valid_wide_char(wchar_t ch)
// Reject lone surrogate characters
return 0;
}
+#if SIZEOF_WCHAR_T > 2
if (ch > MAX_UNICODE) {
// bpo-35883: Reject characters outside [U+0000; U+10ffff] range.
// The glibc mbstowcs() UTF-8 decoder does not respect the RFC 3629,
@@ -136,6 +139,7 @@ is_valid_wide_char(wchar_t ch)
// https://sourceware.org/bugzilla/show_bug.cgi?id=2373
return 0;
}
+#endif
return 1;
}
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index c06ae90ee2b..0fe9f894f05 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2531,7 +2531,9 @@ sys__is_gil_enabled_impl(PyObject *module)
}
+#ifndef MS_WINDOWS
static PerfMapState perf_map_state;
+#endif
PyAPI_FUNC(int) PyUnstable_PerfMapState_Init(void) {
#ifndef MS_WINDOWS