You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Calling a C function that returns a function pointer panics #501
Registering it is fine, its the call that goes, and it goes for every signature I tried.
What is the expected result?
fn() hands back a callable func(int32, int32) int32.
What happens instead?
panic: reflect.MakeFunc: value of type *func(int32, int32) int32 is not assignable to type func(int32, int32) int32
Anything else you feel useful to add?
The RegisterFunc type table has func <=> C function in it, but that only seems to hold in the argument direction. Every other case in that return switch leaves the result as the declared type - the reflect.Func case swaps in a *func, registers into that, and hands the pointer back to MakeFunc, which wont take it.
Been that way since #49 in 2022 as far as I can tell. Fix and a test are in #500.
Activity
purego: fix returning a C function pointer as a Go func (ebitengine#500)