diff options
Diffstat (limited to 'libffi/src/raw_api.c')
| -rw-r--r-- | libffi/src/raw_api.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/libffi/src/raw_api.c b/libffi/src/raw_api.c index c54127e6498..b3ca511463e 100644 --- a/libffi/src/raw_api.c +++ b/libffi/src/raw_api.c @@ -209,22 +209,20 @@ ffi_translate_args (ffi_cif *cif, void *rvalue, (*cl->fun) (cif, rvalue, raw, cl->user_data); } -/* Again, here is the generic version of ffi_prep_raw_closure, which - * will install an intermediate "hub" for translation of arguments from - * the pointer-array format, to the raw format */ - ffi_status -ffi_prep_raw_closure (ffi_raw_closure* cl, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data) +ffi_prep_raw_closure_loc (ffi_raw_closure* cl, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data, + void *codeloc) { ffi_status status; - status = ffi_prep_closure ((ffi_closure*) cl, - cif, - &ffi_translate_args, - (void*)cl); + status = ffi_prep_closure_loc ((ffi_closure*) cl, + cif, + &ffi_translate_args, + codeloc, + codeloc); if (status == FFI_OK) { cl->fun = fun; @@ -236,4 +234,22 @@ ffi_prep_raw_closure (ffi_raw_closure* cl, #endif /* FFI_CLOSURES */ #endif /* !FFI_NATIVE_RAW_API */ + +#if FFI_CLOSURES + +/* Again, here is the generic version of ffi_prep_raw_closure, which + * will install an intermediate "hub" for translation of arguments from + * the pointer-array format, to the raw format */ + +ffi_status +ffi_prep_raw_closure (ffi_raw_closure* cl, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data) +{ + return ffi_prep_raw_closure_loc (cl, cif, fun, user_data, cl); +} + +#endif /* FFI_CLOSURES */ + #endif /* !FFI_NO_RAW_API */ |

