summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-05-18 10:12:01 +0200
committerAraq <rumpf_a@web.de>2013-05-18 10:12:01 +0200
commit46e564f9ee0055365d3a7a96724d2056e133e677 (patch)
tree4c8b24e0163851f46a7acf5ff52511a07fd0e36a /compiler
parentce5a1365c2ef5c0031b90df01d5e5c0da839e008 (diff)
downloadNim-46e564f9ee0055365d3a7a96724d2056e133e677.tar.gz
fixes #440
Diffstat (limited to 'compiler')
-rw-r--r--compiler/c2nim/cpp.nim21
-rw-r--r--compiler/c2nim/tests/systest.c2
2 files changed, 13 insertions, 10 deletions
diff --git a/compiler/c2nim/cpp.nim b/compiler/c2nim/cpp.nim
index c210eca3a..439b000e7 100644
--- a/compiler/c2nim/cpp.nim
+++ b/compiler/c2nim/cpp.nim
@@ -46,16 +46,17 @@ proc parseDefine(p: var TParser): PNode =
     eat(p, pxParLe)
     var params = newNodeP(nkFormalParams, p)
     # return type; not known yet:
-    addSon(params, ast.emptyNode)  
-    var identDefs = newNodeP(nkIdentDefs, p)
-    while p.tok.xkind != pxParRi: 
-      addSon(identDefs, skipIdent(p))
-      skipStarCom(p, nil)
-      if p.tok.xkind != pxComma: break
-      getTok(p)
-    addSon(identDefs, newIdentNodeP("expr", p))
-    addSon(identDefs, ast.emptyNode)
-    addSon(params, identDefs)
+    addSon(params, ast.emptyNode)
+    if p.tok.xkind != pxParRi:
+      var identDefs = newNodeP(nkIdentDefs, p)
+      while p.tok.xkind != pxParRi: 
+        addSon(identDefs, skipIdent(p))
+        skipStarCom(p, nil)
+        if p.tok.xkind != pxComma: break
+        getTok(p)
+      addSon(identDefs, newIdentNodeP("expr", p))
+      addSon(identDefs, ast.emptyNode)
+      addSon(params, identDefs)
     eat(p, pxParRi)
     
     addSon(result, ast.emptyNode) # no generic parameters
diff --git a/compiler/c2nim/tests/systest.c b/compiler/c2nim/tests/systest.c
index b73eb5bee..51509e253 100644
--- a/compiler/c2nim/tests/systest.c
+++ b/compiler/c2nim/tests/systest.c
@@ -9,6 +9,8 @@ extern "C" {
 #  endif
 #endif
 
+#define interrupts() sei()
+
 enum
 {
 /* 8bit, color or not */