Make cfg_if uses more explicit and consistent
This commit changes most uses of cfg_if as follows:
- fallthrough `else` usage is avoided for architecture or OS specific
items
- a comment is added in the final `else` clause to signal intent someone
modifying
It is safer to omit items than include ones for the wrong platform or
architecture.
diff --git a/src/windows.rs b/src/windows.rs
index 3f7f160..21b6e13 100644
--- a/src/windows.rs
+++ b/src/windows.rs
@@ -72,9 +72,11 @@
if #[cfg(all(target_env = "gnu"))] {
pub const L_tmpnam: ::c_uint = 14;
pub const TMP_MAX: ::c_uint = 0x7fff;
- } else {
+ } else if #[cfg(all(target_env = "msvc"))] {
pub const L_tmpnam: ::c_uint = 260;
pub const TMP_MAX: ::c_uint = 0x7fff_ffff;
+ } else {
+ // Unknown target_env
}
}