Skip to content

Commit 98ba455

Browse files
committed
Issue python#10910: Avoid C++ compilation errors on FreeBSD and OS X.
Patch by Ronald Oussoren.
1 parent 285a253 commit 98ba455

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎Include/pyport.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,12 @@ extern int fdatasync(int);
713713
#endif
714714

715715
#ifdef _PY_PORT_CTYPE_UTF8_ISSUE
716+
#ifndef __cplusplus
717+
/* The workaround below is unsafe in C++ because
718+
* the <locale> defines these symbols as real functions,
719+
* with a slightly different signature.
720+
* See issue #10910
721+
*/
716722
#include <ctype.h>
717723
#include <wctype.h>
718724
#undef isalnum
@@ -730,6 +736,7 @@ extern int fdatasync(int);
730736
#undef toupper
731737
#define toupper(c) towupper(btowc(c))
732738
#endif
739+
#endif
733740

734741

735742
/* Declarations for symbol visibility.

0 commit comments

Comments
 (0)