projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge branch 'more-config-types'
[m6w6/ext-psi]
/
src
/
libffi.c
diff --git
a/src/libffi.c
b/src/libffi.c
index f776fb7670455cf50a2758ac3fc7f039d5926837..776e98c143d0fb309c20aa3b096aa60a6a3d49a6 100644
(file)
--- a/
src/libffi.c
+++ b/
src/libffi.c
@@
-91,6
+91,8
@@
static inline ffi_type *psi_ffi_token_type(token_t t) {
return &ffi_type_float;
case PSI_T_DOUBLE:
return &ffi_type_double;
return &ffi_type_float;
case PSI_T_DOUBLE:
return &ffi_type_double;
+ case PSI_T_POINTER:
+ return &ffi_type_pointer;
}
}
static inline ffi_type *psi_ffi_impl_type(token_t impl_type) {
}
}
static inline ffi_type *psi_ffi_impl_type(token_t impl_type) {
@@
-283,10
+285,15
@@
static void psi_ffi_call(PSI_Context *C, decl_callinfo *decl_call, impl_vararg *
params[nfixedargs + i] = psi_ffi_impl_type(va->types[i]);
params[nfixedargs + i + ntotalargs + 1] = &va->values[i];
}
params[nfixedargs + i] = psi_ffi_impl_type(va->types[i]);
params[nfixedargs + i + ntotalargs + 1] = &va->values[i];
}
-
+#ifdef PSI_HAVE_FFI_PREP_CIF_VAR
rc = ffi_prep_cif_var(&signature, call->signature.abi,
nfixedargs, ntotalargs,
call->signature.rtype, (ffi_type **) params);
rc = ffi_prep_cif_var(&signature, call->signature.abi,
nfixedargs, ntotalargs,
call->signature.rtype, (ffi_type **) params);
+#else
+ /* FIXME: test in config.m4; assume we can just call anyway */
+ rc = ffi_prep_cif(&signature, call->signature.abi, ntotalargs,
+ call->signature.rtype, (ffi_type **) params);
+#endif
ZEND_ASSERT(FFI_OK == rc);
ffi_call(&signature, FFI_FN(decl_call->sym), decl_call->rval, ¶ms[ntotalargs + 1]);
free(params);
ZEND_ASSERT(FFI_OK == rc);
ffi_call(&signature, FFI_FN(decl_call->sym), decl_call->rval, ¶ms[ntotalargs + 1]);
free(params);