You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some C structures that cannot be correctly accessed from Go code as Go does
not provide the features needed to access them. Examples are unions, bitfields and
structures that are affected by issue #7560. Therefore, C code is needed to unmarshall
and marshall these structures into Go code.
Sadly, this is very uggly to do right now as there seems to be no sane way of having a C
function operate on types defined in Go code. Right now, I have to define the structure
I'm marshalling into on the C side of code which requires me to marshall the already
marshalled structure again if I want to provide that structure as an interface to other
packages.
Ideally, something like this is possible:
package example
/*
#include "go.h"
// struct I want to marshall
struct something {
// ...
}
void marshall_something(struct something *s, GoSomething *g) {
// unmarshall s into g
}
*/
import "C"
//export
type something struct {
// corresponding Go type that is visible to C
// ...
}
The text was updated successfully, but these errors were encountered:
by fuzxxl:
The text was updated successfully, but these errors were encountered: