Properly guard access to NimCompilerApiVersion.
Makes master compile on latest released Nim 0.18.0.
This commit is contained in:
parent
ee4c0aef26
commit
964af450dd
1 changed files with 3 additions and 3 deletions
|
|
@ -42,12 +42,12 @@ proc isStrLit(n: PNode): bool = n.kind in {nkStrLit..nkTripleStrLit}
|
|||
|
||||
when declared(NimCompilerApiVersion):
|
||||
const finalApi = NimCompilerApiVersion >= 2
|
||||
|
||||
when NimCompilerApiVersion >= 3:
|
||||
import compiler / pathutils
|
||||
else:
|
||||
const finalApi = false
|
||||
|
||||
when NimCompilerApiVersion >= 3:
|
||||
import compiler / pathutils
|
||||
|
||||
proc getGlobal(g: ModuleGraph; ident: PSym): string =
|
||||
when finalApi:
|
||||
let n = vm.getGlobalValue(PCtx g.vm, ident)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue