Commits

Armin Rigo committed b8f2db9

ABI for linux

  • Participants
  • Parent commits f111f6b
  • Branches ffi-backend

Comments (0)

Files changed (2)

File pypy/module/_cffi_backend/__init__.py

 
         'get_errno': 'cerrno.get_errno',
         'set_errno': 'cerrno.set_errno',
+
+        'FFI_DEFAULT_ABI': 'ctypefunc._get_abi(space, "FFI_DEFAULT_ABI")',
+        'FFI_CDECL': 'ctypefunc._get_abi(space,"FFI_DEFAULT_ABI")',#win32 name
         }

File pypy/module/_cffi_backend/ctypefunc.py

 def set_mustfree_flag(data, flag):
     rffi.ptradd(data, -1)[0] = chr(flag)
 
+def _get_abi(space, name):
+    abi = getattr(clibffi, name)
+    assert isinstance(abi, int)
+    return space.wrap(abi)
+
 # ____________________________________________________________
 
 # The "cif" is a block of raw memory describing how to do a call via libffi.