aboutsummaryrefslogtreecommitdiff
path: root/libgo/go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-01-19 02:56:28 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-01-19 02:56:28 +0000
commitb077669c47e8531ba4b2ab0a08581e8856649551 (patch)
tree213b6ebf34f7973be26ddc57f056206aac523f41 /libgo/go
parent342a33940d94a54496f15fa923f3508be19d05e0 (diff)
downloadgcc-b077669c47e8531ba4b2ab0a08581e8856649551.zip
gcc-b077669c47e8531ba4b2ab0a08581e8856649551.tar.gz
gcc-b077669c47e8531ba4b2ab0a08581e8856649551.tar.bz2
reflect: Fix build for systems that do not define ffi_go_closure.
From-SVN: r219831
Diffstat (limited to 'libgo/go')
-rw-r--r--libgo/go/reflect/makefunc.go6
-rw-r--r--libgo/go/reflect/makefunc_ffi.go2
-rw-r--r--libgo/go/reflect/makefunc_ffi_c.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/libgo/go/reflect/makefunc.go b/libgo/go/reflect/makefunc.go
index 71aadfb..7ec277b 100644
--- a/libgo/go/reflect/makefunc.go
+++ b/libgo/go/reflect/makefunc.go
@@ -63,7 +63,7 @@ func MakeFunc(typ Type, fn func(args []Value) (results []Value)) Value {
method: -1,
}
- makeFuncFFI(ftyp, impl)
+ makeFuncFFI(ftyp, unsafe.Pointer(impl))
return Value{t, unsafe.Pointer(&impl), flag(Func) | flagIndir}
}
@@ -102,7 +102,7 @@ func makeMethodValue(op string, v Value) Value {
rcvr: rcvr,
}
- makeFuncFFI(ftyp, fv)
+ makeFuncFFI(ftyp, unsafe.Pointer(fv))
return Value{ft, unsafe.Pointer(&fv), v.flag&flagRO | flag(Func) | flagIndir}
}
@@ -128,7 +128,7 @@ func makeValueMethod(v Value) Value {
rcvr: v,
}
- makeFuncFFI(ftyp, impl)
+ makeFuncFFI(ftyp, unsafe.Pointer(impl))
return Value{t, unsafe.Pointer(&impl), v.flag&flagRO | flag(Func) | flagIndir}
}
diff --git a/libgo/go/reflect/makefunc_ffi.go b/libgo/go/reflect/makefunc_ffi.go
index 6b61f23..c821131 100644
--- a/libgo/go/reflect/makefunc_ffi.go
+++ b/libgo/go/reflect/makefunc_ffi.go
@@ -10,7 +10,7 @@ import (
// The makeFuncFFI function, written in C, fills in an FFI closure.
// It arranges for ffiCall to be invoked directly from FFI.
-func makeFuncFFI(ftyp *funcType, impl *makeFuncImpl)
+func makeFuncFFI(ftyp *funcType, impl unsafe.Pointer)
// FFICallbackGo implements the Go side of the libffi callback.
// It is exported so that C code can call it.
diff --git a/libgo/go/reflect/makefunc_ffi_c.c b/libgo/go/reflect/makefunc_ffi_c.c
index 727ae81..2a98e9b 100644
--- a/libgo/go/reflect/makefunc_ffi_c.c
+++ b/libgo/go/reflect/makefunc_ffi_c.c
@@ -18,7 +18,7 @@
/* Declare C functions with the names used to call from Go. */
-void makeFuncFFI(const struct __go_func_type *ftyp, ffi_go_closure *impl)
+void makeFuncFFI(const struct __go_func_type *ftyp, void *impl)
__asm__ (GOSYM_PREFIX "reflect.makeFuncFFI");
#ifdef USE_LIBFFI_CLOSURES
@@ -70,7 +70,7 @@ ffi_callback (ffi_cif* cif __attribute__ ((unused)), void *results,
/* Allocate an FFI closure and arrange to call ffi_callback. */
void
-makeFuncFFI(const struct __go_func_type *ftyp, ffi_go_closure *impl)
+makeFuncFFI(const struct __go_func_type *ftyp, void *impl)
{
ffi_cif *cif;
@@ -83,7 +83,7 @@ makeFuncFFI(const struct __go_func_type *ftyp, ffi_go_closure *impl)
#else /* !defined(USE_LIBFFI_CLOSURES) */
void
-makeFuncFFI(const struct __go_func_type *ftyp, ffi_go_closure *impl)
+makeFuncFFI(const struct __go_func_type *ftyp, void *impl)
{
runtime_panicstring ("libgo built without FFI does not support "
"reflect.MakeFunc");