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
It would be handy if I could annotate types with the name I want the C header to use. This wouldn't work with functions (since the name in the header must correspond to the name in the library), but it would for types, since the thing we actually care about there is the ABI rather than the name.
As things stand today, I have to live with non-C-friendly type names (e.g., State, which is a recipe for trouble in C's flat namespace) or else I need to compromise on my Rust names (e.g., struct foolib_state). I'd like the ability to explicitly name my generated C types:
I really like this idea, I'll have to give it some thought though. I think the former suggestion is better in the long run, but I don't think there's any way to do it on stable yet (since you'd have to register the attribute with the actual compiler). So I'll probably implement the second suggestion for now, then come back to the first one later if I can think of a good way to implement it.
It would be handy if I could annotate types with the name I want the C header to use. This wouldn't work with functions (since the name in the header must correspond to the name in the library), but it would for types, since the thing we actually care about there is the ABI rather than the name.
As things stand today, I have to live with non-C-friendly type names (e.g.,
State
, which is a recipe for trouble in C's flat namespace) or else I need to compromise on my Rust names (e.g.,struct foolib_state
). I'd like the ability to explicitly name my generated C types:Alternatively (or also?), it would be great if I could tell rusty-cheddar how to automatically C-ify my names:
The text was updated successfully, but these errors were encountered: