mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-17 08:34:20 +00:00
fix duplicate definition
This commit is contained in:
@@ -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] {.
|
||||
|
||||
Reference in New Issue
Block a user