Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crates/wdk-build/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ fn main() {
// Custom attributes cannot be applied to expressions yet, so separate functions
// are required for `rustversion` conditional compilation: https://github.com/rust-lang/rust/issues/15701
// TODO: Remove the `setup_assert_matches_stabilized_cfg` feature and related
// code once the minimum supported Rust version is 1.95.0 or later.
#[rustversion::since(1.95.0)]
// code once the minimum supported Rust version includes stable
// `assert_matches`. Stabilization was reverted from 1.95.0 beta:
// https://github.com/rust-lang/rust/pull/154999
Comment thread
leon-xd marked this conversation as resolved.
Outdated
#[rustversion::since(1.96.0)]
fn setup_assert_matches_stabilized_cfg() {
println!("cargo::rustc-cfg=assert_matches_stabilized");
}

#[rustversion::before(1.95.0)]
#[rustversion::before(1.96.0)]
const fn setup_assert_matches_stabilized_cfg() {}
Comment thread
leon-xd marked this conversation as resolved.
12 changes: 5 additions & 7 deletions crates/wdk-build/src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,15 @@ impl BuilderExt for Builder {
impl ParseCallbacks for WdkCallbacks {
fn generated_name_override(&self, item_info: ItemInfo) -> Option<String> {
// Override the generated name for the WDF function table symbol, since bindgen is unable to currently translate the #define automatically: https://github.com/rust-lang/rust-bindgen/issues/2544
if let Some(wdf_function_table_symbol_name) = &self.wdf_function_table_symbol_name {
if let ItemInfo {
if let Some(wdf_function_table_symbol_name) = &self.wdf_function_table_symbol_name
&& let ItemInfo {
name: item_name,
kind: ItemKind::Var,
..
} = item_info
{
if item_name == wdf_function_table_symbol_name {
return Some("WdfFunctions".to_string());
}
}
&& item_name == wdf_function_table_symbol_name
{
return Some("WdfFunctions".to_string());
}
None
}
Expand Down
16 changes: 8 additions & 8 deletions crates/wdk-build/src/cargo_make.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,14 @@ impl ParseCargoArgs for CompilationOptions {
{
"release" => {
// cargo-make release profile sets the `--profile release` flag
if let Some(profile) = &profile {
if profile != "release" {
eprintln!(
"Specifying `--profile release` for cargo-make conflicts with the \
setting `--profile {profile}` to forward to tasks"
);
std::process::exit(CLAP_USAGE_EXIT_CODE);
}
if let Some(profile) = &profile
&& profile != "release"
{
eprintln!(
"Specifying `--profile release` for cargo-make conflicts with the setting \
`--profile {profile}` to forward to tasks"
);
std::process::exit(CLAP_USAGE_EXIT_CODE);
}

append_to_space_delimited_env_var(
Expand Down
Loading