[go-nuts] Re: Struct Compatibility in unix.Syscall

2016-12-07 Thread Dragos Harabor
Also, take a look at this post: https://utcc.utoronto.ca/~cks/space/blog/programming/GoCGoCompatibleStructs I do quite a bit of ioctl stuff and generate all my Go structs using the cgo tool just because the C side is not stable yet and still changes a lot, I could not keep up with the changes an

[go-nuts] Re: Struct Compatibility in unix.Syscall

2016-12-07 Thread Steven Logan
I was concerned that there might be a fundamental issue that would make this a massive pain, wasn't expecting it to be quite this straight forward. I'll have a go at these suggestions tomorrow, Cheers! -- You received this message because you are subscribed to the Google Groups "golang-nuts" gr

[go-nuts] Re: Struct Compatibility in unix.Syscall

2016-12-07 Thread Dragos Harabor
You can use go tool cgo -godefs *file*.go to generate the Go structs from C structs and either use them as-is or get an idea how you should pad your hand-written Go structs. file.go will have to do an import of the right .h file(s), something like: /* #include "file.h" */ import "C" ... On Tuesd