diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2020-04-06 12:44:07 -0500 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2020-04-06 12:44:07 -0500 |
| commit | e1c8ef2775fda98defbb7f70b976538f24af3b6d (patch) | |
| tree | 24865a3455ed09ed9dc3447a3d4509ee9084acad | |
| parent | e911a9ee92a92beeb66bc716949c4f417fb0f816 (diff) | |
| download | nimterop-e1c8ef2775fda98defbb7f70b976538f24af3b6d.tar.gz nimterop-e1c8ef2775fda98defbb7f70b976538f24af3b6d.zip | |
ast2 dynlib fix, add 1.2.0 testing
| -rw-r--r-- | .travis.yml | 1 | ||||
| -rw-r--r-- | nimterop.nimble | 3 | ||||
| -rw-r--r-- | nimterop/ast2.nim | 7 | ||||
| -rw-r--r-- | nimterop/toast.nim | 4 | ||||
| -rw-r--r-- | tests/tsoloud.nim | 3 |
5 files changed, 15 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index 3201c6c..3b66a7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ language: c env: - BRANCH=0.20.2 - BRANCH=1.0.6 + - BRANCH=1.2.0 - BRANCH=devel cache: diff --git a/nimterop.nimble b/nimterop.nimble index be76135..870322b 100644 --- a/nimterop.nimble +++ b/nimterop.nimble @@ -49,8 +49,7 @@ task test, "Test": execCmd "./nimterop/toast -pnk -E=_ -f:ast2 tests/include/toast.h" execTest "tests/tpcre.nim" - #execTest "tests/tpcre.nim", "-d:FLAGS=\"-f:ast2\"" - #execTest "tests/tpcre.nim", "-d:FLAGS=\"-f:ast2 -H\"" + execTest "tests/tpcre.nim", "-d:FLAGS=\"-f:ast2\"" # Platform specific tests when defined(Windows): diff --git a/nimterop/ast2.nim b/nimterop/ast2.nim index 7becd04..a6610cd 100644 --- a/nimterop/ast2.nim +++ b/nimterop/ast2.nim @@ -386,6 +386,9 @@ proc newXIdent(nimState: NimState, node: TSNode, kind = nskType, fname = "", pra if nimState.includeHeader(): # Add header nimState.addPragma(node, prident[1], nimState.impShort & "H") + elif nimState.gState.dynlib.nBl: + # Add dynlib + nimState.addPragma(node, prident[1], "dynlib", nimState.getIdent(nimState.gState.dynlib)) else: # Only need impShort since no name change prident = nimState.newPragmaExpr(node, ident, nimState.impShort) @@ -1457,6 +1460,10 @@ proc addProc(nimState: NimState, node, rnode: TSNode) = # {.convention.} nimState.addPragma(node, prident, nimState.gState.convention) + if nimState.gState.dynlib.nBl: + # {.dynlib.} for DLLs + nimState.addPragma(node, prident, "dynlib", nimState.getIdent(nimState.gState.dynlib)) + procDef.add prident procDef.add newNode(nkEmpty) procDef.add newNode(nkEmpty) diff --git a/nimterop/toast.nim b/nimterop/toast.nim index a82a4ea..fe63fb9 100644 --- a/nimterop/toast.nim +++ b/nimterop/toast.nim @@ -100,6 +100,10 @@ proc main( symOverride: symOverride ) + # Fail if both includeHeader and dynlib + doAssert not (includeHeader == true and dynlib.nBl), + "`includeHeader` and `dynlib` cannot be used simultaneously" + # Split some arguments with , gState.symOverride = gState.symOverride.getSplitComma() gState.prefix = gState.prefix.getSplitComma() diff --git a/tests/tsoloud.nim b/tests/tsoloud.nim index 9823531..afff0f1 100644 --- a/tests/tsoloud.nim +++ b/tests/tsoloud.nim @@ -43,7 +43,8 @@ cCompile(src/"audiosource", "cpp", exclude="ay/") cCompile(src/"audiosource", "c") cCompile(src/"filter/*.cpp") -cImport(incl/"soloud_c.h") +const FLAGS {.strdefine.} = "" +cImport(incl/"soloud_c.h", flags = FLAGS) var s = Soloud_create() |
