|
|
|
|
|
by berkut
1640 days ago
|
|
Yes, but now try nesting or chaining them... It's do-able with cfg_if crate macro, but I really don't think much of the result in many complex situations, compared to what can be done in C/C++. Also, using the cfg! macro (which you need to do to use it in logic) I think is stripped out at link time (I had all sorts of issues with this), so if you've got intrinsics which don't compile on the current platform, that's not helpful (maybe I did something wrong here, but I've googled it a lot, and asked for help several times on the Rust Discord server). |
|
There are many Rust libraries that support dozen different hardware architectures using conditional compilation.
Rust has many pain points, but conditional compilation isn’t one.
What ever weird constraint or desire you have, a macro would solve it nicely for your case.