-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Some bitflags still need a typedef. #9812
Comments
Just grepping for
|
Slightly off-topic but can I ask what is the reasoning behind having a typedef + macro values instead of simply an enum? I am trying to write a parser to help with #9771 and enums-over-macros would help a lot with parsing these bitflags under a common type. |
Conceptually an enum is simply a set of valid values, and C++ enforces this. To be correct, all of the valid flag combinations would need to be added to the enumeration, which is unwieldy and in some cases not possible. The SDL headers have formalized a typedef followed by defines so language bindings and other parsers can rely on that. |
I see the reasoning, that's unfortunate for C ... Would love to learn more about how this method is handled by language bindings though! |
So if the parser is SDL-specific: by policy, these typedefs always have the https://wiki.libsdl.org/SDL3/SDL_WindowFlags If that makes it easier to parse for SDL specifically. More explanation: https://wiki.libsdl.org/SDL3/README/documentation-rules#defines-right-below-typedefs-and-functions-bind |
Reference Issue libsdl-org#9812.
Reference Issue libsdl-org#9812.
Right now SDL_Surface::flags is a Uint32. It should get the same typedef update (and wikiheaders magic) that other bitflags did.
The text was updated successfully, but these errors were encountered: