From c0b444890407a52f1b812485ea9b89fc7c985e5f Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 5 Aug 2012 16:17:00 +0200 Subject: bugfix: dynlib for variables --- compiler/pragmas.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler') 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) = -- cgit 1.4.1-2-gfad0