-
Notifications
You must be signed in to change notification settings - Fork 743
SDL 3: Failed to resolve compile time constants for SDL_UINT64_C #3098
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
Comments
This seems a duplicate of #753. Could you please try the Thanks! Cc @jbaublitz |
Can confirm from local testing that
The constants are defined as u32, despite the definition of SDL_UINT64_C being
On most configurations ( Redefining Currently this doesn't actually cause any issues, because all the constants in SDL3 defined using |
Let me refresh my working memory of this PR, but as I remember, the Clang API specifically represented these constants as an integer data type without a length encoded. If the Clang API does not actually keep track of integer length for constants that are being evaluated in this context (e.g. integers that may have a length specification in the expression but are without a type binding), there may not be a lot we can do on our side without some additional help from the Clang API. We are relying on Clang to report the type and if they do not, there's no straightforward way for us to guess how big the integer type should be. |
Ah that's unfortunate. So by my understanding, if clang doesn't provide the ULL specifier in the API in some way, that means fixing this properly would have to wait until non-fallback mode can parse and interpret function-like macros? As stated, for now fallback mode works with this particular use case, since all current uses of this macro fall within u32. In the future, it might be nice if something like |
Arguably, it would have to wait until the Clang API provides width information for literals as opposed to a generic integer specification. That applies to the fallback code and the non-fallback code as they are both using the same Clang API and are bound by the same restrictions.
If you're interested in something like this, I think a new issue would absolutely be welcome. @ojeda and @pvdrz are generally pretty open to improving the corner cases and it sounds like there may still be a way to make this better. |
given that |
SDL 3 has window comptime constants wrapped by SDL_UINT64_C, these are important but ignored by rust-bindgen
Source
Expected rust binding
Zig is perfectly able to resolve these
The text was updated successfully, but these errors were encountered: