Skip to content

Commit

Permalink
Update windows bindings and use windows-targets (#653)
Browse files Browse the repository at this point in the history
This synchronizes the API definitions with std. Trouble is,
std uses its own definition of the `windows_targets::link!` macro
so I've used a path hack to include it in this crate when used as
a dependency of std. Otherwise the `windows-targets` crate is used.
  • Loading branch information
ChrisDenton committed Aug 28, 2024
1 parent fc37b22 commit 7d062c6
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 386 deletions.
149 changes: 60 additions & 89 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ cpp_demangle = { default-features = false, version = "0.4.0", optional = true, f
"alloc",
] }

[target.'cfg(windows)'.dependencies]
windows-targets = "0.52.6"

[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
miniz_oxide = { version = "0.8", default-features = false }
addr2line = { version = "0.24.0", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion bindings.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--out src/windows_sys.rs
--config std flatten
--config sys flatten
--filter
Windows.Win32.Foundation.CloseHandle
Windows.Win32.Foundation.FALSE
Expand Down
5 changes: 2 additions & 3 deletions crates/as-if-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ default-features = false
optional = true
features = ['read_core', 'elf', 'macho', 'pe', 'xcoff', 'unaligned', 'archive']

[build-dependencies]
# Dependency of the `backtrace` crate
windows-bindgen = "0.56"
[target.'cfg(windows)'.dependencies]
windows-targets = "0.52.6"

[features]
default = ['backtrace']
Expand Down
Loading

0 comments on commit 7d062c6

Please sign in to comment.