-
Notifications
You must be signed in to change notification settings - Fork 528
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
Add support for bit fields #2942
Comments
I don't see the point of this issue. Since, rust the language itself doesn't support that. I believe this can be reopened and worked on once the lang itself supports it. |
We could add get/set methods. |
We do indeed effectively farm out this responsibility to crates, essentially so that those crates can implement the getters/setters that strike their fancy. I believe rust-bindgen provides some such support. |
I had a look at the metadata but it doesn't appear to include the type of each bitfield. For example, typedef struct FLICK_DATA
{
FLICKACTION_COMMANDCODE iFlickActionCommandCode:5;
FLICKDIRECTION iFlickDirection:3;
BOOL fControlModifier:1;
BOOL fMenuModifier:1;
BOOL fAltGRModifier:1;
BOOL fWinModifier:1;
BOOL fShiftModifier:1;
INT iReserved:2;
BOOL fOnInkingSurface:1;
INT iActionArgument:16;
}FLICK_DATA; But the metadata just contains the offsets: public struct FLICK_DATA
{
[NativeBitfield("iFlickActionCommandCode", 0L, 5L)]
[NativeBitfield("iFlickDirection", 5L, 3L)]
[NativeBitfield("fControlModifier", 8L, 1L)]
[NativeBitfield("fMenuModifier", 9L, 1L)]
[NativeBitfield("fAltGRModifier", 10L, 1L)]
[NativeBitfield("fWinModifier", 11L, 1L)]
[NativeBitfield("fShiftModifier", 12L, 1L)]
[NativeBitfield("iReserved", 13L, 2L)]
[NativeBitfield("fOnInkingSurface", 15L, 1L)]
[NativeBitfield("iActionArgument", 16L, 16L)]
public int _bitfield;
} @riverar do you know if this is intentionally omitting the field types or am I missing something? |
That is... not good. We'll need to fix that upstream. |
Thanks, I'll close this for now then - nothing actionable to do here unfortunately. |
Rust lacks support at the moment: rust-lang/rfcs#314
Metadata now provides this information: microsoft/win32metadata#1392
The text was updated successfully, but these errors were encountered: