PMunch/futhark

Constant values are not included, so they all read as the default value (zero)

DiThi opened this issue · 2 comments

DiThi commented

Here's an example:

https://github.com/ValveSoftware/openvr/blob/master/headers/openvr_capi.h#L65

None of those values are present in the generated bindings (ulongs, cstrings, etc). Therefore ints are zero, cstrings are null, etc.

As a workaround, I used c2nim to translate them and it had some problems: culong/culonglong values were suffixed with 'i64 when culong should be 'u32, and culonglong should be 'u64.

PMunch commented

Hmm, this is unfortunate. I believe it's an easy fix though. Do you find those values in the Opir file?

DiThi commented

I searched for one of the constant strings in the nim cache directory (where I can find opir json files), but it only appears in a cached version of the c2nim version of the module.

Ah also I think the problem persists when I use #define instead of consts. I did try replacing one of them and the result was the same, except that the type was inferred from the literal.