Skip to content

Commit 3dc0915

Browse files
committed
another try to fix page_size can't compile with wasi/wasm
1 parent b429732 commit 3dc0915

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

stdlib/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ num_enum = "0.5.7"
6565
ascii = "1.0.0"
6666

6767
# mmap
68+
[target.'cfg(all(unix, not(target_arch = "wasm32")))'.dependencies]
6869
memmap2 = "0.5"
6970
page_size = "0.4"
7071

stdlib/src/mmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ mod mmap {
115115
#[pyattr]
116116
const ACCESS_COPY: u32 = AccessMode::Copy as u32;
117117

118-
#[cfg(not(any(target_os = "wasi", target_os = "redox", target_arch = "wasm32")))]
118+
#[cfg(all(unix, not(target_arch = "wasm32")))]
119119
#[pyattr(name = "PAGESIZE", once)]
120120
fn page_size(_vm: &VirtualMachine) -> usize {
121121
page_size::get()
122122
}
123123

124-
#[cfg(not(any(target_os = "wasi", target_os = "redox", target_arch = "wasm32")))]
124+
#[cfg(all(unix, not(target_arch = "wasm32")))]
125125
#[pyattr(name = "ALLOCATIONGRANULARITY", once)]
126126
fn granularity(_vm: &VirtualMachine) -> usize {
127127
page_size::get_granularity()

0 commit comments

Comments
 (0)