diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2019-05-07 11:49:19 -0500 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2019-05-07 11:49:19 -0500 |
| commit | 80545a8221b5561ebf22f1ea5a0684ee35832f1e (patch) | |
| tree | 28ad3a0362f3555c1828f6300999e7ee221378c4 | |
| parent | 2457671f9eef2c90fd5f403fbcde97c69c5aa64b (diff) | |
| download | nimterop-80545a8221b5561ebf22f1ea5a0684ee35832f1e.tar.gz nimterop-80545a8221b5561ebf22f1ea5a0684ee35832f1e.zip | |
cdecl by default
| -rw-r--r-- | nimterop/grammar.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nimterop/grammar.nim b/nimterop/grammar.nim index daf5f15..22a0456 100644 --- a/nimterop/grammar.nim +++ b/nimterop/grammar.nim @@ -189,9 +189,9 @@ proc initGrammar(): Grammar = pout = pout[0 .. ^3] if tptr.len != 0 or typ != "object": - nimState.typeStr &= &"\n {nname}*{pragma} = proc({pout}): {getPtrType(tptr&typ)} {{.nimcall.}}" + nimState.typeStr &= &"\n {nname}*{pragma} = proc({pout}): {getPtrType(tptr&typ)} {{.cdecl.}}" else: - nimState.typeStr &= &"\n {nname}*{pragma} = proc({pout}) {{.nimcall.}}" + nimState.typeStr &= &"\n {nname}*{pragma} = proc({pout}) {{.cdecl.}}" else: if i < nimState.data.len and nimState.data[i].name in ["identifier", "number_literal"]: var @@ -321,9 +321,9 @@ proc initGrammar(): Grammar = if pout.len != 0 and pout[^2 .. ^1] == ", ": pout = pout[0 .. ^3] if fptr.len != 0 or ftyp != "object": - nimState.typeStr &= &"\n {fname}*: proc({pout}): {getPtrType(fptr&ftyp)} {{.nimcall.}}" + nimState.typeStr &= &"\n {fname}*: proc({pout}): {getPtrType(fptr&ftyp)} {{.cdecl.}}" else: - nimState.typeStr &= &"\n {fname}*: proc({pout}) {{.nimcall.}}" + nimState.typeStr &= &"\n {fname}*: proc({pout}) {{.cdecl.}}" i += 1 else: if ftyp == "object": @@ -579,7 +579,7 @@ proc initGrammar(): Grammar = if fnname.nBl and nimState.identifiers.addNewIdentifer(fnname): let ftyp = nimState.data[0].val.getIdentifier(nskType, fnname) - pragma = genPragma(nimState.genImportC(fname, fnname)) + pragma = genPragma(nimState.genImportC(fname, fnname), "cdecl") if fptr.len != 0 or ftyp != "object": nimState.procStr &= &"\nproc {fnname}*({pout}): {getPtrType(fptr&ftyp)}{pragma}" |
