authorgravatar for syscall0@protonmail.comsyscall0 <syscall0@protonmail.com> 2019-11-24 19:37:56+03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-24 14:46:22-05:00
logeea8b10463b944dae5434e748c9a5b67c2287bea
tree0a802deddf5dba34b9bc5dd82275eb76b4f90ae4
parent6109e49c5b0341fba8de9cf49e1a4071a7637273

Call DllMain entry point if declared


1 files changed, 5 insertions(+), 0 deletions(-)

lib/std/special/start_lib.zig+5
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1// This file is included in the compilation unit when exporting a DLL on windows.1// This file is included in the compilation unit when exporting a DLL on windows.
22
3const root = @import("root");
3const std = @import("std");4const std = @import("std");
4const builtin = @import("builtin");5const builtin = @import("builtin");
56
...@@ -12,5 +13,9 @@ stdcallcc fn _DllMainCRTStartup(...@@ -12,5 +13,9 @@ stdcallcc fn _DllMainCRTStartup(
12 fdwReason: std.os.windows.DWORD,13 fdwReason: std.os.windows.DWORD,
13 lpReserved: std.os.windows.LPVOID,14 lpReserved: std.os.windows.LPVOID,
14) std.os.windows.BOOL {15) std.os.windows.BOOL {
16 if (@hasDecl(root, "DllMain")) {
17 return root.DllMain(hinstDLL, fdwReason, lpReserved);
18 }
19
15 return std.os.windows.TRUE;20 return std.os.windows.TRUE;
16}21}