Debian Codegraph @

xs/ABI.xs

raw
1 MODULE = FFI::Platypus PACKAGE = FFI::Platypus::ABI
2
3 int
4 verify(abi)
5 int abi
6 PREINIT:
7 ffi_abi ffi_abi;
8 ffi_cif ffi_cif;
9 ffi_type *args[1];
10 CODE:
11 /*
12 * I had at least one report from (unknown version of) libffi
13 * where 999999 was accepted as a legal ABI, and all the other
14 * tests passed
15 */
16 if(abi < FFI_FIRST_ABI || abi > FFI_LAST_ABI)
17 {
18 RETVAL = 0;
19 }
20 else
21 {
22 ffi_abi = abi;
23 if(ffi_prep_cif(&ffi_cif, ffi_abi, 0, &ffi_type_void, args) == FFI_OK)
24 {
25 RETVAL = 1;
26 }
27 else
28 {
29 RETVAL = 0;
30 }
31 }
32 OUTPUT:
33 RETVAL