-
Notifications
You must be signed in to change notification settings - Fork 122
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
Update to ClangSharp 16.0 #1601
Comments
|
@tannergooding I'm working on updating to ClangSharp 16.0. Above is the diff before I try to add the new bitfield parameter. Could you take a look? It looks like |
@tannergooding these enums all seem to have a FORCE_DWORD or FORCE_UINT member which means they should be scraped as UInt32 as with earlier versions right? |
That's how ClangSharp set itself up initially, but it was actually incorrect. Despite the name, MSVC treats these enums as You can see this difference in godbolt here: typedef enum D2D1_ALPHA_MODE {
D2D1_ALPHA_MODE_UNKNOWN = 0,
D2D1_ALPHA_MODE_PREMULTIPLIED = 1,
D2D1_ALPHA_MODE_STRAIGHT = 2,
D2D1_ALPHA_MODE_IGNORE = 3,
D2D1_ALPHA_MODE_FORCE_DWORD = 0xffffffff
};
bool isNegative() { return D2D1_ALPHA_MODE_FORCE_DWORD < 0; }
typedef enum D2D1_ALPHA_MODE_RETYPED : unsigned {
D2D1_ALPHA_MODE_RETYPED_UNKNOWN = 0,
D2D1_ALPHA_MODE_RETYPED_PREMULTIPLIED = 1,
D2D1_ALPHA_MODE_RETYPED_STRAIGHT = 2,
D2D1_ALPHA_MODE_RETYPED_IGNORE = 3,
D2D1_ALPHA_MODE_RETYPED_FORCE_DWORD = 0xffffffff
};
bool isNegativeRetyped() { return D2D1_ALPHA_MODE_RETYPED_FORCE_DWORD < 0; } Which is to say, MSVC never retypes the enum implicitly. It requires you to explicitly opt into a type change via the dedicated language syntax. |
Ok. So all is expected. Thanks! |
Unblocks #1392.
The text was updated successfully, but these errors were encountered: