-
Notifications
You must be signed in to change notification settings - Fork 55
Conversation
8121773
to
ca0884c
Compare
@dcharkes I have added some tests and it all seems to be working. I'll try to do some manual testing on Win32 as you suggested. There's a config key |
@@ -33,6 +34,39 @@ class _ParsedStruc { | |||
(dartHandleMember && config.useDartHandle) || | |||
incompleteStructMember; | |||
|
|||
// A struct without any attribute is definitely not packed. #pragma pack(...) | |||
// also adds an attribute, but it's unexposed and cannot be travesed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document in the readme which of the two ways clang allows to detect in which ones we don't. Then users have a starting point for manually verifying whether it did the right thing for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
external int a; | ||
} | ||
|
||
/// Should be packed with 8. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out that #pragma pack(X) sets the Upper bound value of the alignment. (While the alignment(X) attribute sets the lower bound.) I have updated the test accordingly.
I ran this on |
Awesome! Thanks @mannprerak2 ! |
Closes dart-lang/native#352
@Packed(X)
Struct annotation.structs -> pack
to override the pack values.>=2.13.0-211.6.beta
.3.0.0-beta.1