fix duplicate definition

This commit is contained in:
narimiran
2019-04-12 09:38:22 +02:00
parent 3cf038027b
commit f1c297e439

View File

@@ -4321,25 +4321,6 @@ template doAssertRaises*(exception, code: untyped): typed =
if wrong:
raiseAssert(astToStr(exception) & " wasn't raised by:\n" & astToStr(code))
when defined(cpp) and appType != "lib" and
not defined(js) and not defined(nimscript) and
hostOS != "standalone" and not defined(noCppExceptions):
proc setTerminate(handler: proc() {.noconv.})
{.importc: "std::set_terminate", header: "<exception>".}
setTerminate proc() {.noconv.} =
# Remove ourself as a handler, reinstalling the default handler.
setTerminate(nil)
let ex = getCurrentException()
let trace = ex.getStackTrace()
when defined(genode):
# stderr not available by default, use the LOG session
echo trace & "Error: unhandled exception: " & ex.msg &
" [" & $ex.name & "]\n"
else:
stderr.write trace & "Error: unhandled exception: " & ex.msg &
" [" & $ex.name & "]\n"
quit 1
when not defined(js):
proc toOpenArray*[T](x: seq[T]; first, last: int): openarray[T] {.