fix lazy_import

This commit is contained in:
Intege-rs
2024-11-16 19:22:40 -05:00
parent 47e88a7739
commit d9d4cb3f40

View File

@@ -21,9 +21,9 @@ pub macro lazy_import ( $module:literal $($v:vis fn $name:ident($($pname:ident:
let function = match unsafe { FUNC } { let function = match unsafe { FUNC } {
Some(function) => function, Some(function) => function,
None => unsafe { None => unsafe {
let import = core::mem::transmute($crate::win32::importer::find_import_hashed( let import = core::mem::transmute(find_import_hashed(
const { x::hash_utf8($module.as_bytes()) }, const { fnv1::hash_utf8($module.as_bytes()) },
const { x::hash_utf8(stringify!($name).as_bytes()) } const { fnv1::hash_utf8(stringify!($name).as_bytes()) }
).unwrap_or(0)); ).unwrap_or(0));
FUNC = Some(import); FUNC = Some(import);
import import