projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
EOF syntax error
[m6w6/ext-psi]
/
src
/
libffi.c
diff --git
a/src/libffi.c
b/src/libffi.c
index d802bd1f293ee09aafabb82ff66a4bd4e02abcc0..ee077af19b4b2af2cbba62b6c41dc2961355eaa8 100644
(file)
--- a/
src/libffi.c
+++ b/
src/libffi.c
@@
-1,4
+1,11
@@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "php.h"
#include "php.h"
+
+#ifdef HAVE_LIBFFI
+
#include "php_psi.h"
#include "libffi.h"
#include "php_psi.h"
#include "libffi.h"
@@
-145,7
+152,7
@@
static inline void PSI_LibffiCallInitClosure(PSI_Context *C, PSI_LibffiCall *cal
call->code);
#elif PSI_HAVE_FFI_PREP_CLOSURE
call->code);
#elif PSI_HAVE_FFI_PREP_CLOSURE
- rc = ffi_prep_closure(
data->code, &context->signature, psi_ffi_handler, data
);
+ rc = ffi_prep_closure(
call->code, &context->signature, psi_ffi_handler, impl
);
#else
# error "Neither ffi_prep_closure() nor ffi_prep_closure_loc() available"
#endif
#else
# error "Neither ffi_prep_closure() nor ffi_prep_closure_loc() available"
#endif
@@
-185,14
+192,17
@@
static void psi_ffi_init(PSI_Context *C)
C->context = PSI_LibffiContextInit(NULL);
}
C->context = PSI_LibffiContextInit(NULL);
}
-static void psi_ffi_dtor(PSI_Context *C) {
- size_t i;
+static void psi_ffi_dtor(PSI_Context *C)
+{
+ if (C->decls) {
+ size_t i;
- for (i = 0; i < C->decls->count; ++i) {
- decl *decl = C->decls->list[i];
+
for (i = 0; i < C->decls->count; ++i) {
+
decl *decl = C->decls->list[i];
- if (decl->call.info) {
- PSI_LibffiCallFree(decl->call.info);
+ if (decl->call.info) {
+ PSI_LibffiCallFree(decl->call.info);
+ }
}
}
free(C->context);
}
}
free(C->context);
@@
-257,3
+267,5
@@
PSI_ContextOps *PSI_Libffi(void)
{
return &ops;
}
{
return &ops;
}
+
+#endif /* HAVE_LIBFFI */