Skip to content

Commit 0a34f9d

Browse files
ChrisDentoncuviper
authored andcommitted
Test that raw-dylib works with whitespace paths
(cherry picked from commit 6d20c98)
1 parent 270461e commit 0a34f9d

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
type BOOL = i32;
2+
3+
#[cfg_attr(
4+
target_arch = "x86",
5+
link(name = "bcryptprimitives", kind = "raw-dylib", import_name_type = "undecorated")
6+
)]
7+
#[cfg_attr(not(target_arch = "x86"), link(name = "bcryptprimitives", kind = "raw-dylib"))]
8+
extern "system" {
9+
fn ProcessPrng(pbdata: *mut u8, cbdata: usize) -> BOOL;
10+
}
11+
12+
fn main() {
13+
let mut num: u8 = 0;
14+
unsafe {
15+
ProcessPrng(&mut num, 1);
16+
}
17+
println!("{num}");
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Ensure that raw-dylib still works if the output directory contains spaces.
2+
3+
//@ only-windows-gnu
4+
//@ ignore-cross-compile
5+
//@ needs-dlltool
6+
// Reason: this test specifically checks the dlltool feature,
7+
// which is only used on windows-gnu.
8+
9+
use run_make_support::{rfs, rustc};
10+
11+
fn main() {
12+
let out_dir = std::path::absolute("path with spaces").unwrap();
13+
rfs::create_dir_all(&out_dir);
14+
rustc().crate_type("bin").input("main.rs").out_dir(&out_dir).env("TMP", &out_dir).run();
15+
}

0 commit comments

Comments
 (0)