diff options
author | Araq <rumpf_a@web.de> | 2013-05-18 10:12:01 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-05-18 10:12:01 +0200 |
commit | 46e564f9ee0055365d3a7a96724d2056e133e677 (patch) | |
tree | 4c8b24e0163851f46a7acf5ff52511a07fd0e36a /compiler | |
parent | ce5a1365c2ef5c0031b90df01d5e5c0da839e008 (diff) | |
download | Nim-46e564f9ee0055365d3a7a96724d2056e133e677.tar.gz |
fixes #440
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/c2nim/cpp.nim | 21 | ||||
-rw-r--r-- | compiler/c2nim/tests/systest.c | 2 |
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 */ |