I have an extern function decalred in C
:
//extern void goCallback(const struct libvlc_event_t*, void*);
To be defined in go
:
//export goCallback
func goCallback(event unsafe.Pointer, userData unsafe.Pointer) {
log.Fatal("TODO goCallback")
}
When compiling the code, I get type conflicting errors
# github.com/tarrsalah/libvlc-go
In file included from $WORK/github.com/tarrsalah/libvlc-go/_obj/_cgo_export.c:3:0:
cgo-gcc-export-header-prolog:42:13: error: conflicting types for ‘goCallback’
In file included from $WORK/github.com/tarrsalah/libvlc-go/_obj/_cgo_export.c:3:0:
../../../tarrsalah/libvlc-go/event_manager.go:6:13: note: previous declaration of ‘goCallback’ was here
//extern void goCallback(const struct libvlc_event_t*, void*);
^~~~~~~~~~
/tmp/go-build855229382/github.com/tarrsalah/libvlc-go/_obj/_cgo_export.c:17:6: error: conflicting types for ‘goCallback’
void goCallback(void* p0, void* p1)
^~~~~~~~~~
In file included from $WORK/github.com/tarrsalah/libvlc-go/_obj/_cgo_export.c:3:0:
../../../tarrsalah/libvlc-go/event_manager.go:6:13: note: previous declaration of ‘goCallback’ was here
//extern void goCallback(const struct libvlc_event_t*, void*);
^~~~~~~~~~
What is the go
equivalent to const struct libvlc_event_t*
?