Skip to content

Commit a6b1478

Browse files
committed
Invert mmap implementation #[cfg]
Special-case platforms with `mmap` support, falling back to the `std::fs` implementation for platforms that don't have it.
1 parent 5930de7 commit a6b1478

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/symbolize/gimli.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,20 @@ cfg_if::cfg_if! {
3232
if #[cfg(windows)] {
3333
#[path = "gimli/mmap_windows.rs"]
3434
mod mmap;
35-
} else if #[cfg(target_env = "devkita64")] {
36-
#[path = "gimli/mmap_fake.rs"]
35+
} else if #[cfg(any(
36+
target_os = "android",
37+
target_os = "freebsd",
38+
target_os = "fuchsia",
39+
target_os = "ios",
40+
target_os = "linux",
41+
target_os = "macos",
42+
target_os = "openbsd",
43+
target_os = "solaris",
44+
))] {
45+
#[path = "gimli/mmap_unix.rs"]
3746
mod mmap;
3847
} else {
39-
#[path = "gimli/mmap_unix.rs"]
48+
#[path = "gimli/mmap_fake.rs"]
4049
mod mmap;
4150
}
4251
}

0 commit comments

Comments
 (0)