+++ /dev/null
-/*
- * Named proxy callback function, see
- *
- * https://code.google.com/p/go-wiki/wiki/cgo
- */
-
-#include "callback_proxy.h"
-
-int go_readproxy(void *p, unsigned char *buf, int nbytes);
-
-int
-c_readproxy(void *p, unsigned char *buf, int nbytes)
-{
- return go_readproxy(p, buf, nbytes);
-}
#cgo CFLAGS: -std=c99 -Wall -Werror -pedantic -Ibuild/include/opus
#include <opusfile.h>
#include <string.h>
-#include "callback_proxy.h"
+
+// Uses the same signature as Go, no need for proxy
+int go_readcallback(void *p, unsigned char *buf, int nbytes);
*/
import "C"
buf []byte
}
-//export go_readproxy
-func go_readproxy(p unsafe.Pointer, cbuf *C.uchar, cmaxbytes C.int) C.int {
+//export go_readcallback
+func go_readcallback(p unsafe.Pointer, cbuf *C.uchar, cmaxbytes C.int) C.int {
stream := (*Stream)(p)
maxbytes := int(cmaxbytes)
if maxbytes > cap(stream.buf) {
}
var callbacks = C.struct_OpusFileCallbacks{
- read: C.op_read_func(C.c_readproxy),
+ read: C.op_read_func(C.go_readcallback),
seek: nil,
tell: nil,
close: nil,