Skip to content

Commit ecbd49a

Browse files
committed
Fix pc-windows-gnu builds
1 parent c54579c commit ecbd49a

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

Cargo.toml

+7-5
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ rust-version = "1.65.0"
2020
[workspace]
2121
members = ['crates/cpp_smoke_test', 'crates/as-if-std']
2222
exclude = [
23-
'crates/without_debuginfo',
24-
'crates/macos_frames_test',
25-
'crates/line-tables-only',
26-
'crates/debuglink',
23+
'crates/without_debuginfo',
24+
'crates/macos_frames_test',
25+
'crates/line-tables-only',
26+
'crates/debuglink',
2727
]
2828

2929
[dependencies]
@@ -36,7 +36,7 @@ serde = { version = "1.0", optional = true, features = ['derive'] }
3636

3737
# Optionally demangle C++ frames' symbols in backtraces.
3838
cpp_demangle = { default-features = false, version = "0.4.0", optional = true, features = [
39-
"alloc",
39+
"alloc",
4040
] }
4141

4242
[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
@@ -55,12 +55,14 @@ features = [
5555
"Win32_Foundation",
5656
"Win32_Security",
5757
"Win32_System_Diagnostics_Debug",
58+
"Win32_System_Diagnostics_ToolHelp",
5859
"Win32_System_Kernel",
5960
"Win32_System_LibraryLoader",
6061
"Win32_System_SystemInformation",
6162
"Win32_System_Threading",
6263
"Win32_System_WindowsProgramming",
6364
"Win32_Globalization",
65+
"Win32_System_Memory"
6466
]
6567

6668
[build-dependencies]

src/backtrace/dbghelp32.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
#![allow(bad_style)]
1313

1414
use windows_sys::{
15-
Win32::Foundation::*, Win32::System::Diagnostics::Debug::*,
16-
Win32::System::SystemInformation::*, Win32::System::Threading::*,
15+
Win32::System::Diagnostics::Debug::*, Win32::System::SystemInformation::*,
16+
Win32::System::Threading::*,
1717
};
1818

19-
use super::super::dbghelp;
19+
use super::super::{dbghelp, windows::*};
2020
use core::ffi::c_void;
2121
use core::mem;
2222

src/symbolize/gimli/libs_windows.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use windows_sys::{Win32::Foundation::*, Win32::System::Diagnostics::ToolHelp::*};
2+
13
use super::super::super::windows::*;
24
use super::mystd::os::windows::prelude::*;
35
use super::{coff, mmap, Library, LibrarySegment, OsString};

src/symbolize/gimli/mmap_windows.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
use super::super::super::windows::*;
1+
use windows_sys::{Win32::Foundation::*, Win32::System::Memory::*};
2+
23
use super::mystd::fs::File;
34
use super::mystd::os::windows::prelude::*;
5+
use core::ffi::c_void;
46
use core::ops::Deref;
57
use core::ptr;
68
use core::slice;
@@ -17,14 +19,14 @@ impl Mmap {
1719
pub unsafe fn map(file: &File, len: usize) -> Option<Mmap> {
1820
let file = file.try_clone().ok()?;
1921
let mapping = CreateFileMappingA(
20-
file.as_raw_handle().cast(),
22+
file.as_raw_handle() as isize,
2123
ptr::null_mut(),
2224
PAGE_READONLY,
2325
0,
2426
0,
2527
ptr::null(),
2628
);
27-
if mapping.is_null() {
29+
if mapping == 0 {
2830
return None;
2931
}
3032
let ptr = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, len);

0 commit comments

Comments
 (0)