fixes #4840
This commit is contained in:
parent
6e1313515d
commit
c0470edc4c
1 changed files with 7 additions and 4 deletions
|
|
@ -867,10 +867,11 @@ proc genMainProc(m: BModule) =
|
||||||
MainProcsWithResult =
|
MainProcsWithResult =
|
||||||
MainProcs & "\treturn nim_program_result;$N"
|
MainProcs & "\treturn nim_program_result;$N"
|
||||||
|
|
||||||
NimMainBody =
|
NimMainInner = "N_CDECL(void, NimMainInner)(void) {$N" &
|
||||||
"N_CDECL(void, NimMainInner)(void) {$N" &
|
|
||||||
"$1" &
|
"$1" &
|
||||||
"}$N$N" &
|
"}$N$N"
|
||||||
|
|
||||||
|
NimMainProc =
|
||||||
"N_CDECL(void, NimMain)(void) {$N" &
|
"N_CDECL(void, NimMain)(void) {$N" &
|
||||||
"\tvoid (*volatile inner)();$N" &
|
"\tvoid (*volatile inner)();$N" &
|
||||||
"\tPreMain();$N" &
|
"\tPreMain();$N" &
|
||||||
|
|
@ -879,6 +880,8 @@ proc genMainProc(m: BModule) =
|
||||||
"\t(*inner)();$N" &
|
"\t(*inner)();$N" &
|
||||||
"}$N$N"
|
"}$N$N"
|
||||||
|
|
||||||
|
NimMainBody = NimMainInner & NimMainProc
|
||||||
|
|
||||||
PosixNimMain =
|
PosixNimMain =
|
||||||
"int cmdCount;$N" &
|
"int cmdCount;$N" &
|
||||||
"char** cmdLine;$N" &
|
"char** cmdLine;$N" &
|
||||||
|
|
@ -906,7 +909,7 @@ proc genMainProc(m: BModule) =
|
||||||
" LPSTR lpCmdLine, int nCmdShow) {$N" &
|
" LPSTR lpCmdLine, int nCmdShow) {$N" &
|
||||||
MainProcsWithResult & "}$N$N"
|
MainProcsWithResult & "}$N$N"
|
||||||
|
|
||||||
WinNimDllMain = "N_LIB_EXPORT " & NimMainBody
|
WinNimDllMain = NimMainInner & "N_LIB_EXPORT " & NimMainProc
|
||||||
|
|
||||||
WinCDllMain =
|
WinCDllMain =
|
||||||
"BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, $N" &
|
"BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, $N" &
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue