aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2014-10-17 10:12:25 -0700
committerRichard Henderson <rth@twiddle.net>2014-11-12 09:15:35 +0100
commite951d64c085267a30036907d02f94a70dee4c9d9 (patch)
tree2e465e4bd5f371830b811a5015705be115c97659 /include
parenta0bdc5250cd36f1d2578358e33299fd2408091ac (diff)
downloadplatform_external_libffi-e951d64c085267a30036907d02f94a70dee4c9d9.tar.gz
platform_external_libffi-e951d64c085267a30036907d02f94a70dee4c9d9.tar.bz2
platform_external_libffi-e951d64c085267a30036907d02f94a70dee4c9d9.zip
Add entry points for interacting with Go
A "ffi_go_closure" is intended to be compatible with the function descriptors used by Go, and ffi_call_go sets up the static chain parameter for calling a Go function. The entry points are disabled when a backend has not been updated, much like we do for "normal" closures.
Diffstat (limited to 'include')
-rw-r--r--include/ffi.h.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/ffi.h.in b/include/ffi.h.in
index f403ae0..c43d52f 100644
--- a/include/ffi.h.in
+++ b/include/ffi.h.in
@@ -428,6 +428,22 @@ ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
#endif /* FFI_CLOSURES */
+#if FFI_GO_CLOSURES
+
+typedef struct {
+ void *tramp;
+ ffi_cif *cif;
+ void (*fun)(ffi_cif*,void*,void**,void*);
+} ffi_go_closure;
+
+ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *,
+ void (*fun)(ffi_cif*,void*,void**,void*));
+
+void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
+ void **avalue, void *closure);
+
+#endif /* FFI_GO_CLOSURES */
+
/* ---- Public interface definition -------------------------------------- */
ffi_status ffi_prep_cif(ffi_cif *cif,