The rest of the trouble has to do with the
different meanings between the C
void f(char x[20]);
and the Go
func f(x [20]byte)
The former is really the same as void f(char*),
and the latter is not. What function in libuuid
are you trying to call?
Russ
> C.uuid_generate((*C.uchar)(unsafe.Pointer(&uuid)))
It's not ideal but for now, sure.
I'll take a look at whether cgo should be
doing a better job figuring out the type of
the function argument. C.uuid_generator(&uuid[0])
might work too.
> I was confused looking into generated _cgo_gotypes.go, there I see for
> unsigned char C.unsignedchar and that does not work. Where I can find
> how C primitive types are to be referenced?, cgo command description
> on web does not mention that for unsigned char I should use C.uchar.
I'll add it to the docs, but the list is:
var nameToC = map[string]string{
"schar": "signed char",
"uchar": "unsigned char",
"ushort": "unsigned short",
"uint": "unsigned int",
"ulong": "unsigned long",
"longlong": "long long",
"ulonglong": "unsigned long long",
}
(in addition to the usual char, short, int, long).
Russ