mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 16:12:33 +00:00
Call DllMain entry point if declared
This commit is contained in:
parent
6109e49c5b
commit
eea8b10463
@ -1,5 +1,6 @@
|
|||||||
// This file is included in the compilation unit when exporting a DLL on windows.
|
// This file is included in the compilation unit when exporting a DLL on windows.
|
||||||
|
|
||||||
|
const root = @import("root");
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
@ -12,5 +13,9 @@ stdcallcc fn _DllMainCRTStartup(
|
|||||||
fdwReason: std.os.windows.DWORD,
|
fdwReason: std.os.windows.DWORD,
|
||||||
lpReserved: std.os.windows.LPVOID,
|
lpReserved: std.os.windows.LPVOID,
|
||||||
) std.os.windows.BOOL {
|
) std.os.windows.BOOL {
|
||||||
|
if (@hasDecl(root, "DllMain")) {
|
||||||
|
return root.DllMain(hinstDLL, fdwReason, lpReserved);
|
||||||
|
}
|
||||||
|
|
||||||
return std.os.windows.TRUE;
|
return std.os.windows.TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user