You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some headers (Windows) use structs with missing declarations. When importing the Windows headers, you can #define NONAMELESSUNION to replace all the nameless unions/structs with dummy values. Discussion in #985, #1214, and #4081 might be relevant to how to implement this.
There are four different cases I tried in Zig:
No names defined (valid Zig code, but no elements)
One name defined (valid Zig code with the single named element)
Unnamed struct as a member (invalid Zig code)
Nested struct declaration without a name generates (valid Zig code, generated name)
Based on the fourth case, I believe that the previous three should all be generating unnamed elements instead of excluding them to be consistent. One of the referenced issues mentions that Zig can re-order the struct contents, so it may not be that simple to maintain compatibility.
No names defined generates valid Zig code with no elements:
Some headers (Windows) use structs with missing declarations. When importing the Windows headers, you can
#define NONAMELESSUNION
to replace all the nameless unions/structs with dummy values. Discussion in #985, #1214, and #4081 might be relevant to how to implement this.There are four different cases I tried in Zig:
Based on the fourth case, I believe that the previous three should all be generating unnamed elements instead of excluding them to be consistent. One of the referenced issues mentions that Zig can re-order the struct contents, so it may not be that simple to maintain compatibility.
No names defined generates valid Zig code with no elements:
One name generates valid Zig code with the single named element:
With an unnamed struct, invalid Zig code is generated.
A nested struct declaration without a name generates valid Zig code:
The text was updated successfully, but these errors were encountered: