Skip to content

Commit 970cbcb

Browse files
authored
Merge pull request #4243 from kleisauke/rust-issue-131467
emscripten: Assume version is at least 3.1.42
2 parents f6d00b4 + 99515f2 commit 970cbcb

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
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",
@@ -75,9 +75,9 @@ fn main() {
7575
}
7676

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

8383
let linux_time_bits64 = env::var("RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64").is_ok();

ci/emscripten.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eux
44

55
# Note: keep in sync with:
6-
# https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/emscripten.sh
6+
# https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/platform-support/wasm32-unknown-emscripten.md#requirements
77
emsdk_version=3.1.68
88

99
git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable

src/unix/linux_like/emscripten/mod.rs

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

0 commit comments

Comments
 (0)