Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DiThi opened this issue May 9, 2023 · 2 comments

Comments

@DiThi
Copy link

DiThi commented May 9, 2023

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
Copy link
Owner

PMunch commented May 9, 2023

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

@DiThi
Copy link
Author

DiThi commented May 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants