How to conditionally compile code on target word size in Rust? [duplicate]

On x86 systems, it's usually 32-bit words. On x86_64, it's 64 bits. How can this value be used to conditionally compile code?

The reference lists a number attributes that #[cfg()] exposes, but word size doesn't seem to be one of those exposed.


According to the conditional compilation docs, you can use one of the following to get close to what you're looking for.

target_pointer_width = "..."

target_has_atomic = "..." // one of "8", "16", "32", "64" and "ptr".