Differentiate NativeTypedef structs that exist in the headers vs. only in metadata#1538
Differentiate NativeTypedef structs that exist in the headers vs. only in metadata#1538mikebattista merged 10 commits intomainfrom
Conversation
715e1c9 to
2579722
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
I like the idea of a separate MetadataTypedefAttribute instead. This will allow projection authors to quickly filter out this attribute (if desired). The current implementation requires looking up every single TypedefAttribute to read/compare against its Native value.
|
Can you clarify? These MetadataTypedefs would still be applied to functions, so projections need to inspect an attribute and then unwrap values either way whether it's a different attribute or a single attribute with a property. |
|
The A projection author wishing to ignore non-native typedefs will have fully parse the attribute, perhaps something like: The proposed alternative eliminates a bunch of per-attribute work by simply using the type name: |
|
Ok. I'm fine with that to make the processing more efficient. Your earlier comment suggested maybe a different design altogether for the attribute and how it would be applied. |
|
@mikebattista Oh didn't mean to imply that. Was just agreeing with your "Another option might be MetadataTypedef" 👍 |
originally Windows SDK didn't have a `sa_family_t` typedef, and we requested `win32metadata` to add it (microsoft/win32metadata#1538) and used that from `windows-sys` as our `sa_family_t` definition on Windows platform (#414), which was an oversight. after all, Winsock2 isn't compliant to Posix and has it's own naming scheme, and `ADDRESS_FAMILY` is intended to be the equivalence of `sa_family_t`.
Fixed #1533.
If we agree to just introduce a different attribute for metadata-only typedefs, we need to close on the name. I started with
NoNativeTypedef. Another option might beMetadataTypedef.Projections that want to use all the typedefs should just check for both attributes. Projections that want to stay true to the Win32 headers can unwrap
MetadataTypedefs.We could also merge the two attributes like
Typedef(Native = true)andTypedef(Native = false).