v0.21.0
Major Changes
Portable Types
In #1266, we added support for transpiling portable integer types like size_t and uint64_t. Previously, these were translated in a platform-dependent way, as C defines these portable types as typedefs of the platform-dependent primitive types like int and long.
Now we special case these portable integer types and make sure to translate them as the equivalent Rust portable types, so size_t becomes usize and uint64_t becomes u64, for example.
These still often go through multiple typedefs in C, which become multiple type aliases in Rust, so the definitions are not always textually identical in Rust, but the underlying types should always be portable now.
Const Macros
We previously had an unstable and often broken --translate-const-macros option, which translated const/object-like C macros as Rust consts. This has now been significantly improved and --translate-const-macros conservative is enabled by default. The option has been split into , , and , so we still allow the previous more experimental translations under , but should generally work and thus is enabled by default. However, some const macros are not yet translatable, like macros referencing other variables, functions, etc., which skips, while some const macros can never be properly translated as a Rust , such as when it references a variable that is not yet defined. We're still working on improving these cases so that more const macros can be successfully translated, but the current version should capture most usages in the wild. For , 98% of const macro definitions and expansions are successfully translated, for example.