]> granicus.if.org Git - python/commitdiff
Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X.
authorNed Deily <nad@python.org>
Mon, 15 Aug 2016 06:59:31 +0000 (02:59 -0400)
committerNed Deily <nad@python.org>
Mon, 15 Aug 2016 06:59:31 +0000 (02:59 -0400)
Patch by Ronald Oussoren.

Include/pyport.h

index 2259548ea85c0c2f7f706c2daa7108e6367fec9a..736b984e056a29bed3fa51b56de0d217ba7b981f 100644 (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.