-
Notifications
You must be signed in to change notification settings - Fork 85
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
Define all typedef "constants" as statics on the struct that declares their value type #340
Comments
The metadata defines Alternatively yes we could just specially define a few (e.g. S_OK, S_FALSE, E_FAIL), but then we have to defend why we didn't get certain others that folks will want to see there. |
That plan sounds great to me! |
Ok then here's the overall proposal: move all constants that are typed as a typedef struct to be static members of those structs. So it doesn't just apply to HRESULT. |
For example, this moves the `HRESULT PInvoke.S_OK` static field to the `HRESULT` struct. Closes #340
Generating all constants into the typedef struct by default has a significant code generation perf and size toll. HRESULT would contain ~9000 constants. I'm dropping that part of the goal. Instead, you still have to request each constant (now with wildcards #544), but it will be generated into the typedef struct, when that struct isn't already found in a referenced assembly. |
For example, this moves the `HRESULT PInvoke.S_OK` static field to the `HRESULT` struct. Closes #340
These are nice to have when implementing callbacks that return HRESULT.
In particular, as static members on HRESULT, the IDE will natively make it super easy to autocomplete them:
The text was updated successfully, but these errors were encountered: