cdecl by default
This commit is contained in:
parent
2457671f9e
commit
80545a8221
1 changed files with 5 additions and 5 deletions
|
|
@ -189,9 +189,9 @@ proc initGrammar(): Grammar =
|
||||||
pout = pout[0 .. ^3]
|
pout = pout[0 .. ^3]
|
||||||
|
|
||||||
if tptr.len != 0 or typ != "object":
|
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:
|
else:
|
||||||
nimState.typeStr &= &"\n {nname}*{pragma} = proc({pout}) {{.nimcall.}}"
|
nimState.typeStr &= &"\n {nname}*{pragma} = proc({pout}) {{.cdecl.}}"
|
||||||
else:
|
else:
|
||||||
if i < nimState.data.len and nimState.data[i].name in ["identifier", "number_literal"]:
|
if i < nimState.data.len and nimState.data[i].name in ["identifier", "number_literal"]:
|
||||||
var
|
var
|
||||||
|
|
@ -321,9 +321,9 @@ proc initGrammar(): Grammar =
|
||||||
if pout.len != 0 and pout[^2 .. ^1] == ", ":
|
if pout.len != 0 and pout[^2 .. ^1] == ", ":
|
||||||
pout = pout[0 .. ^3]
|
pout = pout[0 .. ^3]
|
||||||
if fptr.len != 0 or ftyp != "object":
|
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:
|
else:
|
||||||
nimState.typeStr &= &"\n {fname}*: proc({pout}) {{.nimcall.}}"
|
nimState.typeStr &= &"\n {fname}*: proc({pout}) {{.cdecl.}}"
|
||||||
i += 1
|
i += 1
|
||||||
else:
|
else:
|
||||||
if ftyp == "object":
|
if ftyp == "object":
|
||||||
|
|
@ -579,7 +579,7 @@ proc initGrammar(): Grammar =
|
||||||
if fnname.nBl and nimState.identifiers.addNewIdentifer(fnname):
|
if fnname.nBl and nimState.identifiers.addNewIdentifer(fnname):
|
||||||
let
|
let
|
||||||
ftyp = nimState.data[0].val.getIdentifier(nskType, fnname)
|
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":
|
if fptr.len != 0 or ftyp != "object":
|
||||||
nimState.procStr &= &"\nproc {fnname}*({pout}): {getPtrType(fptr&ftyp)}{pragma}"
|
nimState.procStr &= &"\nproc {fnname}*({pout}): {getPtrType(fptr&ftyp)}{pragma}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue