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(...@@ -86,7 +86,7 @@ fn DllMainCRTStartup(
86 }86 }
8787
88 if (@hasDecl(root, "DllMain")) {88 if (@hasDecl(root, "DllMain")) {
89 return root.DllMain(hinstDLL, fdwReason, lpReserved);89 return root.DllMain(@ptrCast(hinstDLL), fdwReason, lpReserved);
90 }90 }
9191
92 return .TRUE;92 return .TRUE;
...@@ -97,7 +97,7 @@ fn DllMain(...@@ -97,7 +97,7 @@ fn DllMain(
97 fdwReason: std.os.windows.DWORD,97 fdwReason: std.os.windows.DWORD,
98 lpReserved: std.os.windows.LPVOID,98 lpReserved: std.os.windows.LPVOID,
99) callconv(.winapi) std.os.windows.BOOL {99) callconv(.winapi) std.os.windows.BOOL {
100 return root.DllMain(hinstDLL, fdwReason, lpReserved);100 return root.DllMain(@ptrCast(hinstDLL), fdwReason, lpReserved);
101}101}
102102
103fn wasm_freestanding_start() callconv(.c) void {103fn wasm_freestanding_start() callconv(.c) void {