-
Notifications
You must be signed in to change notification settings - Fork 84
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
Use System.IO.SeekOrigin
instead of System.Com.STREAM_SEEK
#675
Comments
Sounds good. Thanks for confirming that the values are the same. Are you calling out that the BclInteropStructs support we already have for substituting metadata types with BCL types doesn't yet work for enums? If so, that's something I'd support improving. But in this case, I wonder... what is the benefit of sharing an enum here? The cost is that the enum type used won't match win32 documentation. With structs this cost is often outweighed by the improved interoperability with other BCL-based code. But for a STREAM_SEEK enum, is there material benefit? Will there ever be code that is given one type and must use the other type? I'm not against consolidating these two types, ... but if there's no know benefit, I'm on the fence. |
Winforms uses the BCL enum on its IF we replace it, it will be used everywhere and so that concern won't matter for code we generate. Even if a user passes the enum to external win32 code it shouldn't be a problem because the underlying type of the enum is the same. I can see how the docs could be an issue. There would be marginally less generated code and its not hard to cast between the enums. So the benefit isn't massive. |
Thanks. I'm still on the fence but I'd accept a PR for this. |
Do we have a policy on using BCL structs/enums? I know we use a few BCL structs where it directly mirrors win32api (blittable). |
This is what I'd suggest as a policy:
|
The values match between them.
We need something like
BclInteropStructs
in the Generator for BCL enums. Allowing us to replace a generated enum with an enum from the BCL.The text was updated successfully, but these errors were encountered: