Description cgo can now handle "manual" structs. These are structs
that are declared explicitly rather than through typedefs.
They are useful when the C code being adapted does not
typedef the structs to a C name and instead refers to
them directly. You can refer to structs like this using
types like C.struct_structname.
This change also includes a change for go-mode.el which
will correct an indentation problem when indenting identifiers
that contain keywords followed by underscores.
Both of these fixes are total hacks and are probably
not ultimately sufficient. One potential problem with
the coerced struct names is that it still does not work
if the C code takes a hybrid approach. For example
typedef struct foo { int a; } foo;
void do_a(struct foo *f);
void do_b(foo *f);
Both do_a and do_b are valid C code, but it doesn't seem
like there's a way to make them both accessible from
C.foo or C.struct_foo at this point. cgo still needs
to be enhanced to handle this case.
I would appreciate advice on how to test this change
in a way that would prevent it from breaking in the
future. Although maybe that's not so much of a concern
considering the lack of testing around cgo.
Patch Set 1 #
Total comments: 3
MessagesTotal messages: 2
|
||||||||||||||||||||||||||||