diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-10-03 21:19:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-03 21:19:55 +0200 |
commit | 79ddf0611df88a301d174bc8027237c9383528d6 (patch) | |
tree | 47688a49eb9457c4abacaeef94528b2091281ed4 | |
parent | 6e1313515df4ee5808c77af5aeacfa77fce42474 (diff) | |
parent | c0470edc4c0179dbe234409f8aa9f655bea415d9 (diff) | |
download | Nim-79ddf0611df88a301d174bc8027237c9383528d6.tar.gz |
Merge pull request #4850 from jangko/win_nimmain_export
fixes #4840
-rw-r--r-- | compiler/cgen.nim | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 620ee4887..d80a68609 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -867,10 +867,11 @@ proc genMainProc(m: BModule) = MainProcsWithResult = MainProcs & "\treturn nim_program_result;$N" - NimMainBody = - "N_CDECL(void, NimMainInner)(void) {$N" & + NimMainInner = "N_CDECL(void, NimMainInner)(void) {$N" & "$1" & - "}$N$N" & + "}$N$N" + + NimMainProc = "N_CDECL(void, NimMain)(void) {$N" & "\tvoid (*volatile inner)();$N" & "\tPreMain();$N" & @@ -879,6 +880,8 @@ proc genMainProc(m: BModule) = "\t(*inner)();$N" & "}$N$N" + NimMainBody = NimMainInner & NimMainProc + PosixNimMain = "int cmdCount;$N" & "char** cmdLine;$N" & @@ -906,7 +909,7 @@ proc genMainProc(m: BModule) = " LPSTR lpCmdLine, int nCmdShow) {$N" & MainProcsWithResult & "}$N$N" - WinNimDllMain = "N_LIB_EXPORT " & NimMainBody + WinNimDllMain = NimMainInner & "N_LIB_EXPORT " & NimMainProc WinCDllMain = "BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, $N" & |