summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorEmery Hemingway <ehmry@posteo.net>2018-05-04 07:40:40 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-05-04 07:40:40 +0200
commitcda591a42f5c3ef29911078c862cb6c07e35f651 (patch)
tree53f6f11e8b1761125481d3fb25ecb142280f6234 /lib/system.nim
parent27631b1112bb10e4a7ca43b611c2d3bde2ba320f (diff)
downloadNim-cda591a42f5c3ef29911078c862cb6c07e35f651.tar.gz
Disable setTerminate when noCppExceptions is defined (#7751)
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 0c8659fda..5781aff27 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -4172,8 +4172,9 @@ 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":
+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.} =