When trying to extract the constants, CrystalLib will output the following, when I would have expected the actual integers:
IPPROTO_IP = IPPROTO_IP
IPPROTO_TCP = IPPROTO_TCP
I tried to investigate if we could know that the macro definition was inside an enum but to no avail, the visit(cursor) method first receives the macros then the enum declaration. I can't even export the enum and have constants use its values since the enum is unamed —and this is an internal implementation detail that wouldn't play well with other libc anyway.
I stumbled upon some enums in linux libc headers that look like this (I'm trying to automatize Crystal's LibC definitions):
When trying to extract the constants, CrystalLib will output the following, when I would have expected the actual integers:
I tried to investigate if we could know that the macro definition was inside an enum but to no avail, the
visit(cursor)
method first receives the macros then the enum declaration. I can't even export the enum and have constants use its values since the enum is unamed —and this is an internal implementation detail that wouldn't play well with other libc anyway.