Commit eea8b10463
Changed files (1)
lib
std
special
lib/std/special/start_lib.zig
@@ -1,5 +1,6 @@
// This file is included in the compilation unit when exporting a DLL on windows.
+const root = @import("root");
const std = @import("std");
const builtin = @import("builtin");
@@ -12,5 +13,9 @@ stdcallcc fn _DllMainCRTStartup(
fdwReason: std.os.windows.DWORD,
lpReserved: std.os.windows.LPVOID,
) std.os.windows.BOOL {
+ if (@hasDecl(root, "DllMain")) {
+ return root.DllMain(hinstDLL, fdwReason, lpReserved);
+ }
+
return std.os.windows.TRUE;
}