| ... | @@ -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. |
| 2 | | 2 | |
| | 3 | const root = @import("root"); |
| 3 | const std = @import("std"); | 4 | const std = @import("std"); |
| 4 | const builtin = @import("builtin"); | 5 | const builtin = @import("builtin"); |
| 5 | | 6 | |
| ... | @@ -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 | } |