sysasserts leaner again

This commit is contained in:
Araq 2012-01-29 02:20:59 +01:00
commit 40881a4140

View file

@ -835,16 +835,10 @@ proc quit*(errorcode: int = QuitSuccess) {.
## It does *not* call the garbage collector to free all the memory, ## It does *not* call the garbage collector to free all the memory,
## unless a quit procedure calls ``GC_collect``. ## unless a quit procedure calls ``GC_collect``.
proc WriteStackTrace()
var checkDisabled: bool
template sysAssert(cond, msg: expr) = template sysAssert(cond, msg: expr) =
when defined(useSysAssert): when defined(useSysAssert):
if not checkDisabled and not cond: if not cond:
checkDisabled = true
echo "[SYSASSERT] ", msg echo "[SYSASSERT] ", msg
WriteStackTrace()
quit 1 quit 1
nil nil