Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3224,6 +3224,8 @@ fn test_freebsd(target: &str) {

fn test_emscripten(target: &str) {
assert!(target.contains("emscripten"));
#[expect(unused_variables)] // remove once we need a version check
let emscripten = VERSIONS.emscripten.unwrap();

let mut cfg = ctest_cfg();
cfg.define("_GNU_SOURCE", None); // FIXME(emscripten): ??
Expand Down Expand Up @@ -6368,6 +6370,7 @@ struct Versions {
openbsd: Option<(u32, u32)>,
netbsd: Option<(u32, u32)>,
macos: Option<(u32, u32)>,
emscripten: Option<(u32, u32)>,
}

impl Versions {
Expand Down Expand Up @@ -6397,6 +6400,11 @@ impl Versions {
*/
#include "sys/param.h"
#endif

#ifdef __EMSCRIPTEN__
/* Provides __EMSCRIPTEN_MAJOR__, __EMSCRIPTEN_MINOR__ */
#include "emscripten/version.h"
#endif
"#;

let mut ret = Versions::default();
Expand Down Expand Up @@ -6471,6 +6479,12 @@ impl Versions {
let minor: u32 = caps[2].parse().unwrap();
ret.openbsd = Some((major, minor));
}
"__EMSCRIPTEN_major__" => {
ret.emscripten.get_or_insert_default().0 = value.parse().unwrap()
}
"__EMSCRIPTEN_minor__" => {
ret.emscripten.get_or_insert_default().1 = value.parse().unwrap()
}
_ => (),
}
}
Expand Down