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

Patch by Ronald Oussoren.
This commit is contained in:
Ned Deily 2016-08-15 03:07:26 -04:00
parent 80a3ba90fd
commit 7659aab5e9
1 changed files with 7 additions and 0 deletions

View File

@ -688,6 +688,12 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
#endif
#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 <wctype.h>
#undef isalnum
@ -705,6 +711,7 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
#undef toupper
#define toupper(c) towupper(btowc(c))
#endif
#endif
/* Declarations for symbol visibility.