aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/sbkpython.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-08-24 08:50:12 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-08-24 08:50:12 +0200
commitd9aed0193b47664af5ec6b92f99fe8cca7f94246 (patch)
treec1aa628b681ef5c8d924e33194b90f8804dcf9e5 /sources/shiboken2/libshiboken/sbkpython.h
parentb45a890df5bb26c3a4feb8d57dd994fdaaf9c750 (diff)
parentb5a574eaeeb6a4f30794e6012b96f05a3de49217 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkpython.h')
-rw-r--r--sources/shiboken2/libshiboken/sbkpython.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/sbkpython.h b/sources/shiboken2/libshiboken/sbkpython.h
index 28814a68e..610e4a3c7 100644
--- a/sources/shiboken2/libshiboken/sbkpython.h
+++ b/sources/shiboken2/libshiboken/sbkpython.h
@@ -48,7 +48,13 @@
#if defined(slots) && (defined(__GNUC__) || defined(_MSC_VER) || defined(__clang__))
# pragma push_macro("slots")
# undef slots
+/*
+ * Python 2 has function _Py_Mangle directly in Python.h .
+ * This creates wrong language binding unless we define 'extern "C"' here.
+ */
+extern "C" {
# include <Python.h>
+}
# include <structmember.h>
// Now we have the usual variables from Python.h .
# include "python25compat.h"
@@ -57,7 +63,9 @@
# include "typespec.h"
# pragma pop_macro("slots")
#else
+extern "C" {
# include <Python.h>
+}
# include <structmember.h>
// Now we have the usual variables from Python.h .
# include "python25compat.h"