summaryrefslogtreecommitdiff
path: root/cffi/recompiler.py
diff options
context:
space:
mode:
authorMatt Davis <mrd@redhat.com>2022-06-29 14:18:20 -0700
committerMatt Davis <mrd@redhat.com>2022-06-29 14:18:20 -0700
commita70b1c7085907fa8788aeda91a6794862227b32d (patch)
tree1cb58cb08e8ecf0dfcb8f59ff8ac63a6df6f7c8d /cffi/recompiler.py
parente9eaaac45c89e7b3fab12524049fdf7d2e18f6db (diff)
parenteaa9538f4130d7953297e1926ec4c08bd6c8d9f0 (diff)
downloadcffi-a70b1c7085907fa8788aeda91a6794862227b32d.tar.gz
hg merge default to release-1.15
Diffstat (limited to 'cffi/recompiler.py')
-rw-r--r--cffi/recompiler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cffi/recompiler.py b/cffi/recompiler.py
index 86b37d7..5d9d32d 100644
--- a/cffi/recompiler.py
+++ b/cffi/recompiler.py
@@ -407,7 +407,7 @@ class Recompiler:
prnt(' NULL, /* no includes */')
prnt(' %d, /* num_types */' % (len(self.cffi_types),))
flags = 0
- if self._num_externpy:
+ if self._num_externpy > 0 or self.ffi._embedding is not None:
flags |= 1 # set to mean that we use extern "Python"
prnt(' %d, /* flags */' % flags)
prnt('};')
@@ -422,7 +422,7 @@ class Recompiler:
prnt('PyMODINIT_FUNC')
prnt('_cffi_pypyinit_%s(const void *p[])' % (base_module_name,))
prnt('{')
- if self._num_externpy:
+ if flags & 1:
prnt(' if (((intptr_t)p[0]) >= 0x0A03) {')
prnt(' _cffi_call_python_org = '
'(void(*)(struct _cffi_externpy_s *, char *))p[1];')