Commit 7659aab5 authored by Ned Deily's avatar Ned Deily

Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X.

Patch by Ronald Oussoren.
parent 80a3ba90
...@@ -688,6 +688,12 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); ...@@ -688,6 +688,12 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
#endif #endif
#ifdef _PY_PORT_CTYPE_UTF8_ISSUE #ifdef _PY_PORT_CTYPE_UTF8_ISSUE
#ifndef __cplusplus
/* The workaround below is unsafe in C++ because
* the <locale> defines these symbols as real functions,
* with a slightly different signature.
* See issue #10910
*/
#include <ctype.h> #include <ctype.h>
#include <wctype.h> #include <wctype.h>
#undef isalnum #undef isalnum
...@@ -705,6 +711,7 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); ...@@ -705,6 +711,7 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
#undef toupper #undef toupper
#define toupper(c) towupper(btowc(c)) #define toupper(c) towupper(btowc(c))
#endif #endif
#endif
/* Declarations for symbol visibility. /* Declarations for symbol visibility.
......
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