X Tutup
Skip to content

Commit 137973f

Browse files
committed
fixed page_size can't compile with wasi
1 parent 8b41436 commit 137973f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

stdlib/src/mmap.rs

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

118+
#[cfg(not(any(target_os = "wasi", target_os = "redox")))]
118119
#[pyattr(name = "PAGESIZE", once)]
119120
fn page_size(_vm: &VirtualMachine) -> usize {
120121
page_size::get()
121122
}
122123

123-
#[pyattr(name = "error", once)]
124-
fn error_type(vm: &VirtualMachine) -> PyTypeRef {
125-
vm.ctx.exceptions.os_error.to_owned()
126-
}
127-
124+
#[cfg(not(any(target_os = "wasi", target_os = "redox")))]
128125
#[pyattr(name = "ALLOCATIONGRANULARITY", once)]
129126
fn granularity(_vm: &VirtualMachine) -> usize {
130127
page_size::get_granularity()
131128
}
132129

130+
#[pyattr(name = "error", once)]
131+
fn error_type(vm: &VirtualMachine) -> PyTypeRef {
132+
vm.ctx.exceptions.os_error.to_owned()
133+
}
134+
133135
#[derive(Debug)]
134136
enum MmapObj {
135137
Write(MmapMut),

0 commit comments

Comments
 (0)
X Tutup