Rollup merge of #129378 - goffrie:patch-3, r=ChrisDenton

Clean up cfg-gating of ProcessPrng extern

This removes a bit of duplication and is consistent with how `api-ms-win-core-synch-l1-2-0` externs are imported.
This commit is contained in:
Jubilee 2024-08-28 19:12:51 -07:00 committed by GitHub
commit fcb6b7792d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -109,19 +109,15 @@ pub struct MOUNT_POINT_REPARSE_BUFFER {
} }
// Use raw-dylib to import ProcessPrng as we can't rely on there being an import library. // Use raw-dylib to import ProcessPrng as we can't rely on there being an import library.
cfg_if::cfg_if! { #[cfg(not(target_vendor = "win7"))]
if #[cfg(not(target_vendor = "win7"))] { #[cfg_attr(
#[cfg(target_arch = "x86")] target_arch = "x86",
#[link(name = "bcryptprimitives", kind = "raw-dylib", import_name_type = "undecorated")] link(name = "bcryptprimitives", kind = "raw-dylib", import_name_type = "undecorated")
extern "system" { )]
#[cfg_attr(not(target_arch = "x86"), link(name = "bcryptprimitives", kind = "raw-dylib"))]
extern "system" {
pub fn ProcessPrng(pbdata: *mut u8, cbdata: usize) -> BOOL; pub fn ProcessPrng(pbdata: *mut u8, cbdata: usize) -> BOOL;
} }
#[cfg(not(target_arch = "x86"))]
#[link(name = "bcryptprimitives", kind = "raw-dylib")]
extern "system" {
pub fn ProcessPrng(pbdata: *mut u8, cbdata: usize) -> BOOL;
}
}}
// Functions that aren't available on every version of Windows that we support, // Functions that aren't available on every version of Windows that we support,
// but we still use them and just provide some form of a fallback implementation. // but we still use them and just provide some form of a fallback implementation.