[pypy-commit] cffi default: Expose at least the value of FFI_DEFAULT_ABI.

arigo noreply at buildbot.pypy.org
Mon Jul 9 22:02:21 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r619:d331e7610d12
Date: 2012-07-09 22:02 +0200
http://bitbucket.org/cffi/cffi/changeset/d331e7610d12/

Log:	Expose at least the value of FFI_DEFAULT_ABI.

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -4018,5 +4018,14 @@
     if (v == NULL || PyModule_AddObject(m, "__version__", v) < 0)
         return;
 
+#if defined(MS_WIN32) && !defined(_WIN64)
+    v = PyInt_FromLong(FFI_STDCALL);
+    if (v == NULL || PyModule_AddObject(m, "FFI_STDCALL", v) < 0)
+        return;
+#endif
+    v = PyInt_FromLong(FFI_DEFAULT_ABI);
+    if (v == NULL || PyModule_AddObject(m, "FFI_DEFAULT_ABI", v) < 0)
+        return;
+
     init_errno();
 }
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -1534,3 +1534,6 @@
     assert get_errno() == 89
     f(); f()
     assert get_errno() == 77
+
+def test_abi():
+    assert isinstance(FFI_DEFAULT_ABI, int)


More information about the pypy-commit mailing list