-
Notifications
You must be signed in to change notification settings - Fork 113
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
System.FlagsAttribute no longer appears on any enum types #72
Comments
I just put bitwise operators on any enums with an unsigned underlying type. No attribute needed. 😊 |
For .NET we definitely want the |
Naturally, you'll want the attribute for the C# projection but the metadata doesn't have to include it for you to generate it. |
It does, because I can't assume that all enums should be treated as Flags. Surely some methods accept an enum where only one value should be specified, and the enums that define such values should not define a Flags attribute. |
I'd love to see such a concrete example. 😉 I'm not saying we shouldn't have an attribute - I'm just not sure it's necessary. |
Ok, here you go: padding schemes from bcrypt
So yes, we certainly have cases where a parameter type can be just one. Now I'm not sure if this particular case I found would actually be an enum in the header files or the metadata. But the ideal projection as defined by how a hand-written one would be, would define this as a non-Flags enum. |
Those aren't enums... 😏 By the way, Win32 enums that provide bitwise operators are identified by the |
Thanks for the tip, @kennykerr. @sotteson1, can we bring back the attribute based on this hint? |
@AArnott - yes, any attributes that are flags should be marked appropriately. Since I can't get this automatically from the headers, we will need to add them manually to an input file (the system for this already exists). I'm not sure why it disappeared for DXGI_ADAPTER_FLAG or others but I'll look into it. |
I'm adding Flags to DXGI_ADAPTER_FLAG and a couple others. I'm going to make the scraper look for DEFINE_ENUM_FLAG_OPERATORS to automatically get more of them. |
The old metadata used to put the flags attribute on enums like
DXGI_ADAPTER_FLAG
. Now the attribute no longer appears.This attribute is used by projections to generate bitwise operators for these enums.
The text was updated successfully, but these errors were encountered: