agemogolk/clay — comment on commit 19ea25fd8f2e53ac175245e162f97a1b4460b8ed
File:  line 0
By jckarter:

On Wed, Nov 30, 2011 at 6:23 PM, agemogolk <
reply@reply.github.com
> wrote:

> Sure, I'll look at adding a few tests for some of the stuff i've been
> adding. Probably be next week though as I'm pretty busy for a few days,
> just really needed random generation to work.
>
> btw, bindgen doesn't build (at least on my platform).
>
> [ 92%] Built target clay
> [ 92%] Generating clay-bindgen
> ###############################
> [..In, ..Out, fn | CallDefined?(fn, ..In)]
> inline overload CCodePointer[[..In], [..Out]](static fn) :
> CCodePointer[[..In], [..Out]]
> = makeCCodePointer(fn, ..In);
> ------^
>
> ###############################
> /home/jeremy/Dev/clay/projects/clay/lib-clay/pointers/pointers.clay(256,6):
> error: argument 1: expected CCodePointer[[Struct_Unnamed4,
> Struct_Unnamed4, Pointer[UInt8]], [UInt8]] type, but received
> CCodePointer[[Struct_Unnamed4, Struct_Unnamed4, Pointer[UInt8]],
> [Int32]] type
>
> compilation context:
> CCodePointer[[Struct_Unnamed4, Struct_Unnamed4, Pointer[UInt8]],
> [UInt8]](Static[visitToplevel])
> main(Int32, Pointer[Pointer[Int8]])
> getExitCode(Int32)
> callMain(Static[main])
> make[2]: *** [tools/clay-bindgen] Error 255
> make[1]: *** [tools/CMakeFiles/clay-bindgen.dir/all] Error 2
> make: *** [all] Error 2

Looks like a difference in how the old and new bindgens handle enums. The
new bindgen maps enums to the actual underlying C type whereas the old one
just always mapped them to Int32 without even making an alias. You could
change the visit* functions to return CXChildVisit instead of Int32 and
that will hopefully fix it,though you'll also have to cast the
CX_ChildVisit* constants, which is annoying. bindgen should emit the enum
constants as the right literal type as well.

-Joe