aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/sbkpython.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkpython.h')
-rw-r--r--sources/shiboken2/libshiboken/sbkpython.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/sbkpython.h b/sources/shiboken2/libshiboken/sbkpython.h
index fbac016eb..29e25605a 100644
--- a/sources/shiboken2/libshiboken/sbkpython.h
+++ b/sources/shiboken2/libshiboken/sbkpython.h
@@ -42,7 +42,13 @@
#include "sbkversion.h"
+/*
+ * 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"