Ticket #44288: issue10910-workaround.txt

File issue10910-workaround.txt, 563 bytes (added by mbrethen, 10 years ago)
Line 
1diff --git a/Include/pyport.h b/Include/pyport.h
2--- a/Include/pyport.h
3+++ b/Include/pyport.h
4@@ -699,6 +699,12 @@
5 #endif
6 
7 #ifdef _PY_PORT_CTYPE_UTF8_ISSUE
8+#ifndef __cplusplus
9+   /* The workaround below is unsafe in C++ because
10+    * the <locale> defines these symbols as real functions,
11+    * with a slightly different signature.
12+    * See issue #10910
13+    */
14 #include <ctype.h>
15 #include <wctype.h>
16 #undef isalnum
17@@ -716,6 +722,7 @@
18 #undef toupper
19 #define toupper(c) towupper(btowc(c))
20 #endif
21+#endif
22 
23 
24 /* Declarations for symbol visibility.