diff options
author | Araq <rumpf_a@web.de> | 2012-03-31 01:03:14 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-03-31 01:03:14 +0200 |
commit | 142e849b91cb39976ec2ca78e0c7a998288a367a (patch) | |
tree | a69f6871ae430bb0c5314fcf812b5ce28b665cbc /compiler/cgen.nim | |
parent | 97743faa837b4e7ec4db0af59d7aafd5d09deee7 (diff) | |
download | Nim-142e849b91cb39976ec2ca78e0c7a998288a367a.tar.gz |
implemented support for the AVR CPU and standalone OS
Diffstat (limited to 'compiler/cgen.nim')
-rwxr-xr-x | compiler/cgen.nim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index e9d7673bb..d85d3fe53 100755 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -778,6 +778,9 @@ proc genMainProc(m: BModule) = PosixCMain = "int main(int argc, char** args, char** env) {$n" & " cmdLine = args;$n" & " cmdCount = argc;$n" & " gEnv = env;$n" & " NimMain();$n" & " return nim_program_result;$n" & "}$n" + StandaloneCMain = "int main(void) {$n" & + " NimMain();$n" & + " return 0;$n" & "}$n" WinNimMain = "N_CDECL(void, NimMain)(void) {$n" & CommonMainBody & "}$n" WinCMain = "N_STDCALL(int, WinMain)(HINSTANCE hCurInstance, $n" & @@ -807,7 +810,10 @@ proc genMainProc(m: BModule) = elif optGenDynLib in gGlobalOptions: nimMain = posixNimDllMain otherMain = posixCDllMain - else: + elif platform.targetOS == osStandalone: + nimMain = PosixNimMain + otherMain = StandaloneCMain + else: nimMain = PosixNimMain otherMain = PosixCMain if gBreakpoints != nil: discard cgsym(m, "dbgRegisterBreakpoint") |