Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
b077669c
Commit
b077669c
authored
Jan 19, 2015
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reflect: Fix build for systems that do not define ffi_go_closure.
From-SVN: r219831
parent
342a3394
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
libgo/go/reflect/makefunc.go
+3
-3
libgo/go/reflect/makefunc_ffi.go
+1
-1
libgo/go/reflect/makefunc_ffi_c.c
+3
-3
No files found.
libgo/go/reflect/makefunc.go
View file @
b077669c
...
...
@@ -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
}
}
...
...
libgo/go/reflect/makefunc_ffi.go
View file @
b077669c
...
...
@@ -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.
...
...
libgo/go/reflect/makefunc_ffi_c.c
View file @
b077669c
...
...
@@ -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"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment