From 8b16160b6ffeb11048be32402841bf2f2ef07a16 Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Fri, 1 May 2026 17:14:10 -0700 Subject: [PATCH] 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. --- lib/std/start.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/start.zig b/lib/std/start.zig index 4d170c17048cfb2498349baebdd614b71e84094d..1387f0385dbf1b3dbf466514e1fbe052ef9ac4e1 100644 --- 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 { -- 2.54.0