mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-17 22:41:14 +00:00
--os:standalone works again
This commit is contained in:
4
tests/manyloc/standalone/barebone.nim
Normal file
4
tests/manyloc/standalone/barebone.nim
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
proc printf(frmt: cstring) {.varargs, header: "<stdio.h>", cdecl.}
|
||||
|
||||
printf("hi %ld\n", 4777)
|
||||
2
tests/manyloc/standalone/barebone.nimrod.cfg
Normal file
2
tests/manyloc/standalone/barebone.nimrod.cfg
Normal file
@@ -0,0 +1,2 @@
|
||||
--os:standalone
|
||||
--deadCodeElim:on
|
||||
19
tests/manyloc/standalone/panicoverride.nim
Normal file
19
tests/manyloc/standalone/panicoverride.nim
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
proc printf(frmt: cstring) {.varargs, importc, header: "<stdio.h>", cdecl.}
|
||||
proc exit(code: int) {.importc, header: "<stdlib.h>", cdecl.}
|
||||
|
||||
{.push stack_trace: off, profiler:off.}
|
||||
|
||||
proc rawoutput(s: string) =
|
||||
printf("%s\n", s)
|
||||
|
||||
proc panic(s: string) =
|
||||
rawoutput(s)
|
||||
exit(1)
|
||||
|
||||
# Alternatively we also could implement these 2 here:
|
||||
#
|
||||
# template sysFatal(exceptn: typeDesc, message: string)
|
||||
# template sysFatal(exceptn: typeDesc, message, arg: string)
|
||||
|
||||
{.pop.}
|
||||
Reference in New Issue
Block a user