Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRFC: #[cfg(…)] syntax for size and alignment of FFI types #1354
Conversation
This comment has been minimized.
This comment has been minimized.
|
Conditions in conditional compilation should just be Rust expressions, don't create a new mini-language for this purpose. Instead of adding tons of special cases to |
mzabaluev
added some commits
Nov 8, 2015
This comment has been minimized.
This comment has been minimized.
|
@dgrunwald: Thanks, I have added your suggestion to the Alternatives section. I'd like to see more design details on that, as it certainly seems a much more extensive change than the one I'm proposing. |
nrc
added
T-dev-tools
T-compiler
T-lang
and removed
T-dev-tools
labels
Nov 10, 2015
This comment has been minimized.
This comment has been minimized.
|
We discussed this RFC in both the compiler and lang subteam meetings, and found a number of drawbacks:
Thoughts? |
This comment has been minimized.
This comment has been minimized.
|
Sorry, I should have added: all that said, I can certainly see why it'd be sometimes be much easier to select based on the size of an integer or something like that, which seems like it might cut across target OS / architectures in a convenient way. Though I'd be a bit nervous when it comes to struct layout, since I think that can often vary by O/S in small ways, even if the architecture is the same. But perhaps this doesn't matter much in practice. |
This comment has been minimized.
This comment has been minimized.
DemiMarie
commented
Dec 4, 2015
|
One feature I would like to see is something like D's |
This comment has been minimized.
This comment has been minimized.
|
We discussed this again in the compiler team meeting and decided to close this RFC for now, for the reasons cited previously. Thanks very much for the suggestion! |
mzabaluev commentedNov 6, 2015
Add syntax for the #[cfg(...)] attribute to support conditional compilation dependent on size and alignment of primitive types used in FFI.
Rendered