added a bunch of hostOS standalone conditions

This commit is contained in:
Simon Hafner 2013-06-30 16:41:21 -05:00
commit 36b00a107c
3 changed files with 826 additions and 787 deletions

View file

@ -7,10 +7,13 @@
# distribution, for details about the copyright.
#
when defined(arduino):
include "system/arduino"
# Bare-bones implementation of some things for embedded targets.
proc writeToStdErr(msg: CString) = write(stdout, msg)
when not defined(arduino):
proc writeToStdErr(msg: CString) = write(stdout, msg)
proc chckIndx(i, a, b: int): int {.inline, compilerproc.}
proc chckRange(i, a, b: int): int {.inline, compilerproc.}
@ -42,11 +45,6 @@ proc reraiseException() {.compilerRtl.} =
proc WriteStackTrace() = nil
proc setControlCHook(hook: proc () {.noconv.}) =
# ugly cast, but should work on all architectures:
type TSignalHandler = proc (sig: cint) {.noconv.}
c_signal(SIGINT, cast[TSignalHandler](hook))
proc raiseRangeError(val: biggestInt) {.compilerproc, noreturn, noinline.} =
writeToStdErr("value out of range")