From 78018cb527a55617653ea389ecc3ec36efb7afe3 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Sat, 3 Feb 2024 13:49:41 -0800 Subject: [PATCH] Switch to cfg_if! --- src/unix/linux_like/emscripten/mod.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index e3a1472b8e220..eb1b33b0e0c8d 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -26,10 +26,13 @@ pub type clock_t = c_long; // And it's still int64 today. The change from long to int was marked as a // nonfunctional change since wasm64 was considered to be not working yet in // v3.1.11. So it suffices to say it's 32 bit until v3.1.16 and 64 bit after. -#[cfg(emscripten_64_bit_time_t)] -pub type time_t = i64; -#[cfg(not(emscripten_64_bit_time_t))] -pub type time_t = i32; +cfg_if! { + if #[cfg(emscripten_64_bit_time_t)] { + pub type time_t = i64; + } else { + pub type time_t = i32; + } +} pub type suseconds_t = c_long; pub type ino_t = u64;