commit 8b16160b6ffeb11048be32402841bf2f2ef07a16 (tree)
parent 5aeeb6a0a496b962638fdfd6d20d289e27f10112
Author: Ryan Liptak <squeek502@hotmail.com>
Date: Fri, 1 May 2026 17:14:10 -0700
DllMain symbols: use ptrCast to allow using non-std pointer type
`HINSTANCE` is `*opaque {}` so using a type that should be compatible from alternate bindings (zigwin32, for example) would be a (false positive) compile error without this ptrCast.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/std/start.zig b/lib/std/start.zig
@@ -86,7 +86,7 @@ fn DllMainCRTStartup(
}
if (@hasDecl(root, "DllMain")) {
- return root.DllMain(hinstDLL, fdwReason, lpReserved);
+ return root.DllMain(@ptrCast(hinstDLL), fdwReason, lpReserved);
}
return .TRUE;
@@ -97,7 +97,7 @@ fn DllMain(
fdwReason: std.os.windows.DWORD,
lpReserved: std.os.windows.LPVOID,
) callconv(.winapi) std.os.windows.BOOL {
- return root.DllMain(hinstDLL, fdwReason, lpReserved);
+ return root.DllMain(@ptrCast(hinstDLL), fdwReason, lpReserved);
}
fn wasm_freestanding_start() callconv(.c) void {