]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libffi/src/raw_api.c
ffi.h.in (ffi_closure_alloc, [...]): New.
[thirdparty/gcc.git] / libffi / src / raw_api.c
index c54127e6498a6e5726fcb38af625fb7e111f132b..b3ca511463e3f1654a78f35d00921397e2c9c577 100644 (file)
@@ -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 */