From 13981e19977fe655a77a1796a2ca58c20a1bea29 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Wed, 30 Jan 2019 11:52:13 -0600 Subject: [PATCH] Workaround gc crash on Windows --- config.nims | 7 ++++++- nimterop/types.nim | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config.nims b/config.nims index 5aac628..f553869 100644 --- a/config.nims +++ b/config.nims @@ -1,5 +1,6 @@ #[ -see D20190127T231316 workaround for fact that toast needs to build scanner.cc, which would otherwise result in link erros such as: +see D20190127T231316 workaround for fact that toast needs to build +scanner.cc, which would otherwise result in link errors such as: "std::terminate()", referenced from: ___clang_call_terminate in scanner.cc.o ]# @@ -7,3 +8,7 @@ when defined(MacOSX): switch("clang.linkerexe", "g++") else: switch("gcc.linkerexe", "g++") + +# Workaround for NilAccessError crash on Windows +when defined(Windows): + switch("gc", "markAndSweep") \ No newline at end of file diff --git a/nimterop/types.nim b/nimterop/types.nim index bea883e..cfbdf2b 100644 --- a/nimterop/types.nim +++ b/nimterop/types.nim @@ -76,5 +76,4 @@ template defineEnum*(typ: untyped) = proc `mod`*(x: int, y: typ): typ {.borrow.} proc `mod`*(x, y: typ): typ {.borrow.} - proc `$` *(x: typ): string {.borrow.} \ No newline at end of file