Closed TheFern2 closed 2 years ago
In C int
means 32-bit, if you use int
in Go on a 64-bit machine, it will be long
in C, which is different type.
Usually advanced API headers don't use those types as-is, and use stdint.h
, which also adds strict type.
Anyway, I think proper way to do it is to make a hand-made wrapper around generated bindings.
Ah ok appreciate the response, nvm if c int is always 32bits then it makes sense to leave it as int32. I was originally under the impression that it could be both 32, and 64bits.
I'd like to keep c int as go int, instead of int32 to make it more portable.
Can this be done?