diff options
author | Araq <rumpf_a@web.de> | 2012-08-05 16:17:00 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-08-05 16:17:00 +0200 |
commit | c0b444890407a52f1b812485ea9b89fc7c985e5f (patch) | |
tree | 7c3a21e488f76f583a1d73dd114fa649ad4fdaa0 | |
parent | 19bc408ec6554da592a875ed8dc4d07b8838f975 (diff) | |
download | Nim-c0b444890407a52f1b812485ea9b89fc7c985e5f.tar.gz |
bugfix: dynlib for variables
-rwxr-xr-x | compiler/pragmas.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index fd637f4c7..273bf98e8 100755 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -224,8 +224,9 @@ proc processDynLib(c: PContext, n: PNode, sym: PSym) = incl(sym.loc.flags, lfExportLib) # since we'll be loading the dynlib symbols dynamically, we must use # a calling convention that doesn't introduce custom name mangling - # cdecl is the default - the use can override this explicitly - if sym.typ.callConv == ccDefault: + # cdecl is the default - the user can override this explicitly + if sym.kind in RoutineKinds and sym.typ != nil and + sym.typ.callConv == ccDefault: sym.typ.callConv = ccCDecl proc processNote(c: PContext, n: PNode) = |