Skip to content

Commit 2cbf270

Browse files
authored
Rollup merge of rust-lang#138233 - smmalis37:no-advapi32, r=ChrisDenton
Windows: Don't link std (and run-make) against advapi32, except on win7 Std no longer depends on any functionality provided by advapi32, so we can remove it from the list of external libraries we link against. Except, the win7 targets do still rely on advapi32-provided functionality. This PR therefore moves linking against it to only occur on win7 targets, so that no new uses of it slip in without being noticed.
2 parents 5890e4e + dd01425 commit 2cbf270

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

windows_targets/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub macro link {
3434
}
3535

3636
#[cfg(not(feature = "windows_raw_dylib"))]
37-
#[link(name = "advapi32")]
37+
#[cfg_attr(target_vendor = "win7", link(name = "advapi32"))]
3838
#[link(name = "ntdll")]
3939
#[link(name = "userenv")]
4040
#[link(name = "ws2_32")]

0 commit comments

Comments
 (0)