authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-05-01 17:14:10-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-05-02 02:44:26-07:00
log8b16160b6ffeb11048be32402841bf2f2ef07a16
tree0dbbc4b512a64c655b255f6386b4b55e0c8d2d52
parent5aeeb6a0a496b962638fdfd6d20d289e27f10112

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.

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/start.zig+2-2
......@@ -86,7 +86,7 @@ fn DllMainCRTStartup(
8686 }
8787
8888 if (@hasDecl(root, "DllMain")) {
89 return root.DllMain(hinstDLL, fdwReason, lpReserved);
89 return root.DllMain(@ptrCast(hinstDLL), fdwReason, lpReserved);
9090 }
9191
9292 return .TRUE;
......@@ -97,7 +97,7 @@ fn DllMain(
9797 fdwReason: std.os.windows.DWORD,
9898 lpReserved: std.os.windows.LPVOID,
9999) callconv(.winapi) std.os.windows.BOOL {
100 return root.DllMain(hinstDLL, fdwReason, lpReserved);
100 return root.DllMain(@ptrCast(hinstDLL), fdwReason, lpReserved);
101101}
102102
103103fn wasm_freestanding_start() callconv(.c) void {