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 02:59:31 -04:00
parent 285a2537c8
commit 98ba455b9a
1 changed files with 7 additions and 0 deletions

View File

@ -713,6 +713,12 @@ extern int fdatasync(int);
#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
@ -730,6 +736,7 @@ extern int fdatasync(int);
#undef toupper
#define toupper(c) towupper(btowc(c))
#endif
#endif
/* Declarations for symbol visibility.