From 547ee5801ec01ba9363b8de2a0f173bd824e4a24 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Fri, 19 Jul 2019 19:38:41 -0500 Subject: Minor c2nim fixes --- nimterop/cimport.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nimterop/cimport.nim b/nimterop/cimport.nim index a4e1761..1249ee9 100644 --- a/nimterop/cimport.nim +++ b/nimterop/cimport.nim @@ -586,7 +586,8 @@ macro c2nImport*(filename: static string, recurse: static bool = false, dynlib: doAssert fileExists(hpath), "Unable to write temporary header file: " & hpath var - cmd = &"c2nim {hpath} --header:{header}" + cmd = when defined(Windows): "cmd /c " else: "" + cmd &= &"c2nim {hpath} --header:{header}" if dynlib.len != 0: cmd.add &" --dynlib:{dynlib}" @@ -600,7 +601,7 @@ macro c2nImport*(filename: static string, recurse: static bool = false, dynlib: let (c2nimout, ret) = gorgeEx(cmd, cache=getCacheValue(hpath)) - doAssert ret == 0, c2nimout + doAssert ret == 0, "Command failed:\n " & cmd var nimout = &"const {header} = \"{fullpath}\"\n\n" & readFile(npath) -- cgit v1.2.3