summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-03-03 21:30:02 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-03-04 15:41:07 +0100
commit4700018d7ecd17882664ddf072f8e6cdebe438b5 (patch)
tree279cab3412cdd26213bafc1230e01238a24fc62a /compiler
parenta6d49c3a81acb453306a902b08e5bac52fe1ea47 (diff)
downloadNim-4700018d7ecd17882664ddf072f8e6cdebe438b5.tar.gz
cgen.nim: code cleanups
Diffstat (limited to 'compiler')
-rw-r--r--compiler/cgen.nim32
1 files changed, 17 insertions, 15 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index d8f426f05..45daa00d9 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -699,23 +699,24 @@ proc generateHeaders(m: BModule) =
   for it in m.headerFiles:
     if it[0] == '#':
       add(m.s[cfsHeaders], rope(it.replace('`', '"') & "\L"))
-    elif it[0] notin {'\"', '<'}:
+    elif it[0] notin {'"', '<'}:
       addf(m.s[cfsHeaders], "#include \"$1\"$N", [rope(it)])
     else:
       addf(m.s[cfsHeaders], "#include $1$N", [rope(it)])
-  add(m.s[cfsHeaders], "#undef LANGUAGE_C\L")
-  add(m.s[cfsHeaders], "#undef MIPSEB\L")
-  add(m.s[cfsHeaders], "#undef MIPSEL\L")
-  add(m.s[cfsHeaders], "#undef PPC\L")
-  add(m.s[cfsHeaders], "#undef R3000\L")
-  add(m.s[cfsHeaders], "#undef R4000\L")
-  add(m.s[cfsHeaders], "#undef i386\L")
-  add(m.s[cfsHeaders], "#undef linux\L")
-  add(m.s[cfsHeaders], "#undef mips\L")
-  add(m.s[cfsHeaders], "#undef near\L")
-  add(m.s[cfsHeaders], "#undef far\L")
-  add(m.s[cfsHeaders], "#undef powerpc\L")
-  add(m.s[cfsHeaders], "#undef unix\L")
+  add(m.s[cfsHeaders], """#undef LANGUAGE_C
+#undef MIPSEB
+#undef MIPSEL
+#undef PPC
+#undef R3000
+#undef R4000
+#undef i386
+#undef linux
+#undef mips
+#undef near
+#undef far
+#undef powerpc
+#undef unix
+""")
 
 proc openNamespaceNim(namespace: string): Rope =
   result.add("namespace ")
@@ -1358,7 +1359,8 @@ proc genMainProc(m: BModule) =
       m.s[cfsProcs].add closeNamespaceNim() & "using namespace " & m.config.cppCustomNamespace & ";\L"
 
     appcg(m, m.s[cfsProcs], otherMain, [])
-    if m.config.cppCustomNamespace.len > 0: m.s[cfsProcs].add openNamespaceNim(m.config.cppCustomNamespace)
+    if m.config.cppCustomNamespace.len > 0:
+      m.s[cfsProcs].add openNamespaceNim(m.config.cppCustomNamespace)
 
 proc registerModuleToMain(g: BModuleList; m: BModule) =
   let