Author: Armin Rigo <[email protected]>
Branch:
Changeset: r2993:bd1327fdae8a
Date: 2017-07-20 09:07 +0200
http://bitbucket.org/cffi/cffi/changeset/bd1327fdae8a/
Log: Support some sub-combination involving C++ and Python 3.x
diff --git a/cffi/_embedding.h b/cffi/_embedding.h
--- a/cffi/_embedding.h
+++ b/cffi/_embedding.h
@@ -1,6 +1,11 @@
/***** Support code for embedding *****/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#if defined(_MSC_VER)
# define CFFI_DLLEXPORT __declspec(dllexport)
#elif defined(__GNUC__)
@@ -525,3 +530,7 @@
#undef cffi_compare_and_swap
#undef cffi_write_barrier
#undef cffi_read_barrier
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/cffi/recompiler.py b/cffi/recompiler.py
--- a/cffi/recompiler.py
+++ b/cffi/recompiler.py
@@ -412,6 +412,9 @@
prnt(' }')
prnt(' p[0] = (const void *)0x%x;' % self._version)
prnt(' p[1] = &_cffi_type_context;')
+ prnt('#if PY_MAJOR_VERSION >= 3')
+ prnt(' return NULL;')
+ prnt('#endif')
prnt('}')
# on Windows, distutils insists on putting init_cffi_xyz in
# 'export_symbols', so instead of fighting it, just give up and
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit