Author: Armin Rigo <[email protected]>
Branch: cffi-1.0
Changeset: r77269:2efe35fea551
Date: 2015-05-10 09:02 +0200
http://bitbucket.org/pypy/pypy/changeset/2efe35fea551/
Log: Change the versions to include "2.6" in it, which is the next pypy
version; and also export a version number before the call to
_cffi_pypyinit_*()
diff --git a/pypy/module/_cffi_backend/cffi1_module.py
b/pypy/module/_cffi_backend/cffi1_module.py
--- a/pypy/module/_cffi_backend/cffi1_module.py
+++ b/pypy/module/_cffi_backend/cffi1_module.py
@@ -7,8 +7,10 @@
from pypy.module._cffi_backend.lib_obj import W_LibObject
-VERSION_MIN = 0x010000f0
-VERSION_MAX = 0x0100ffff
+VERSION_MIN = 0x2600
+VERSION_MAX = 0x260F
+
+VERSION_EXPORT = 0x0A02
initfunctype = lltype.Ptr(lltype.FuncType([rffi.VOIDPP], lltype.Void))
@@ -16,7 +18,8 @@
def load_cffi1_module(space, name, path, initptr):
# This is called from pypy.module.cpyext.api.load_extension_module()
initfunc = rffi.cast(initfunctype, initptr)
- with lltype.scoped_alloc(rffi.VOIDPP.TO, 2, zero=True) as p:
+ with lltype.scoped_alloc(rffi.VOIDPP.TO, 2) as p:
+ p[0] = rffi.cast(rffi.VOIDP, VERSION_EXPORT)
initfunc(p)
version = rffi.cast(lltype.Signed, p[0])
if not (VERSION_MIN <= version <= VERSION_MAX):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit