diff --git a/mozjs-sys/Cargo.toml b/mozjs-sys/Cargo.toml index 99eb8538330..5587fdb84c6 100644 --- a/mozjs-sys/Cargo.toml +++ b/mozjs-sys/Cargo.toml @@ -2,7 +2,7 @@ name = "mozjs_sys" description = "System crate for the Mozilla SpiderMonkey JavaScript engine." repository.workspace = true -version = "0.128.3-3" +version = "0.128.3-4" authors = ["Mozilla"] links = "mozjs" build = "build.rs" diff --git a/mozjs-sys/build.rs b/mozjs-sys/build.rs index f45db78240f..10f14f30733 100644 --- a/mozjs-sys/build.rs +++ b/mozjs-sys/build.rs @@ -704,7 +704,8 @@ mod jsglue { let confdefs_path: PathBuf = outdir.join("js/src/js-confdefs.h"); let msvc = if build.get_compiler().is_like_msvc() { - build.flag(&format!("-FI{}", confdefs_path.to_string_lossy())); + build.flag("-FI"); + build.flag(&confdefs_path); build.define("WIN32", ""); build.flag("-Zi"); build.flag("-GR-"); @@ -733,19 +734,13 @@ mod jsglue { .clang_args(["-I", &include_path.to_string_lossy()]) .enable_cxx_namespaces() .allowlist_file("./src/jsglue.cpp") - .allowlist_recursively(false); + .allowlist_recursively(false) + .clang_args(["-include", &confdefs_path.to_str().expect("UTF-8")]); if msvc { - builder = builder.clang_args([ - "-fms-compatibility", - &format!("-FI{}", confdefs_path.to_string_lossy()), - "-DWIN32", - "-std=c++17", - ]) + builder = builder.clang_args(["-fms-compatibility", "-DWIN32", "-std=c++17"]) } else { - builder = builder - .clang_args(["-fPIC", "-fno-rtti", "-std=c++17"]) - .clang_args(["-include", &confdefs_path.to_str().expect("UTF-8")]) + builder = builder.clang_args(["-fPIC", "-fno-rtti", "-std=c++17"]) } for ty in BLACKLIST_TYPES { diff --git a/mozjs-sys/tests/streams_available.rs b/mozjs-sys/tests/streams_available.rs new file mode 100644 index 00000000000..d0f11fcdb27 --- /dev/null +++ b/mozjs-sys/tests/streams_available.rs @@ -0,0 +1,22 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#![cfg(feature = "streams")] + +use mozjs_sys::glue::ReadableStreamUnderlyingSourceTraps; + +static UNDERLYING_SOURCE_TRAPS: ReadableStreamUnderlyingSourceTraps = + ReadableStreamUnderlyingSourceTraps { + requestData: None, + writeIntoReadRequestBuffer: None, + cancel: None, + onClosed: None, + onErrored: None, + finalize: None, + }; + +#[test] +fn test_ok() { + assert!(UNDERLYING_SOURCE_TRAPS.requestData.is_none()); +}