summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNed Deily <nad@python.org>2016-08-15 06:59:31 (GMT)
committerNed Deily <nad@python.org>2016-08-15 06:59:31 (GMT)
commit98ba455b9afe3fa78751ecae2e9d29f1ba82e7f7 (patch)
treeba52f35fd2309922affe996a4394805945dc3a08
parent285a2537c86947bdf757802b6fcff7ad6af4df5b (diff)
downloadcpython-98ba455b9afe3fa78751ecae2e9d29f1ba82e7f7.zip
cpython-98ba455b9afe3fa78751ecae2e9d29f1ba82e7f7.tar.gz
cpython-98ba455b9afe3fa78751ecae2e9d29f1ba82e7f7.tar.bz2
Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X.
Patch by Ronald Oussoren.
-rw-r--r--Include/pyport.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 2259548..736b984 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -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.