[pypy-svn] r73580 - pypy/trunk/pypy/rlib

afa at codespeak.net afa at codespeak.net
Fri Apr 9 13:31:57 CEST 2010


Author: afa
Date: Fri Apr  9 13:31:56 2010
New Revision: 73580

Modified:
   pypy/trunk/pypy/rlib/libffi.py
Log:
ffi_abi is an enum, don't assume it's USHORT on all platforms.
msvc indeed turns it into an int, and I've seen garbage values when running tests on top of pypy-c.


Modified: pypy/trunk/pypy/rlib/libffi.py
==============================================================================
--- pypy/trunk/pypy/rlib/libffi.py	(original)
+++ pypy/trunk/pypy/rlib/libffi.py	Fri Apr  9 13:31:56 2010
@@ -128,6 +128,7 @@
     FFI_TYPE_STRUCT = rffi_platform.ConstantInteger('FFI_TYPE_STRUCT')
 
     size_t = rffi_platform.SimpleType("size_t", rffi.ULONG)
+    ffi_abi = rffi_platform.SimpleType("ffi_abi", rffi.USHORT)
 
     ffi_type = rffi_platform.Struct('ffi_type', [('size', rffi.ULONG),
                                                  ('alignment', rffi.USHORT),
@@ -171,6 +172,7 @@
 
 FFI_TYPE_P.TO.become(cConfig.ffi_type)
 size_t = cConfig.size_t
+ffi_abi = cConfig.ffi_abi
 
 for name in type_names:
     locals()[name] = configure_simple_type(name)
@@ -352,7 +354,7 @@
 
 VOIDPP = rffi.CArrayPtr(rffi.VOIDP)
 
-c_ffi_prep_cif = external('ffi_prep_cif', [FFI_CIFP, rffi.USHORT, rffi.UINT,
+c_ffi_prep_cif = external('ffi_prep_cif', [FFI_CIFP, ffi_abi, rffi.UINT,
                                            FFI_TYPE_P, FFI_TYPE_PP], rffi.INT)
 if _WIN32:
     c_ffi_call_return_type = rffi.INT



More information about the Pypy-commit mailing list