Skip to content

Commit e7a9c4a

Browse files
kleisauketgross35
authored andcommitted
emscripten: Assume version is at least 3.1.42
This revises commit 63b0d67 to assume that Emscripten 3.1.42 or later is being used whenever `emcc` is not available. Since Emscripten 3.1.42 was released on June 23, 2023, the majority of users are expected to have upgraded to a more recent version. Resolves: rust-lang/rust#131467. (backport <rust-lang#4243">) (cherry picked from commit b511f66)
1 parent 608f947 commit e7a9c4a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

build.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{env, str};
55
// need to know all the possible cfgs that this script will set. If you need to set another cfg
66
// make sure to add it to this list as well.
77
const ALLOWED_CFGS: &'static [&'static str] = &[
8-
"emscripten_new_stat_abi",
8+
"emscripten_old_stat_abi",
99
"espidf_time32",
1010
"freebsd10",
1111
"freebsd11",
@@ -74,9 +74,9 @@ fn main() {
7474
}
7575

7676
match emcc_version_code() {
77-
Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"),
78-
// Non-Emscripten or version < 3.1.42.
79-
Some(_) | None => (),
77+
Some(v) if (v < 30142) => set_cfg("emscripten_old_stat_abi"),
78+
// Non-Emscripten or version >= 3.1.42.
79+
_ => (),
8080
}
8181

8282
// On CI: deny all warnings

src/unix/linux_like/emscripten/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,16 @@ s! {
227227
}
228228
pub struct stat {
229229
pub st_dev: crate::dev_t,
230-
#[cfg(not(emscripten_new_stat_abi))]
230+
#[cfg(emscripten_old_stat_abi)]
231231
__st_dev_padding: c_int,
232-
#[cfg(not(emscripten_new_stat_abi))]
232+
#[cfg(emscripten_old_stat_abi)]
233233
__st_ino_truncated: c_long,
234234
pub st_mode: crate::mode_t,
235235
pub st_nlink: crate::nlink_t,
236236
pub st_uid: crate::uid_t,
237237
pub st_gid: crate::gid_t,
238238
pub st_rdev: crate::dev_t,
239-
#[cfg(not(emscripten_new_stat_abi))]
239+
#[cfg(emscripten_old_stat_abi)]
240240
__st_rdev_padding: c_int,
241241
pub st_size: off_t,
242242
pub st_blksize: crate::blksize_t,

0 commit comments

Comments
 (0)