define nimVersion automatically and avoid needing -d:nimVersion140 (#18726)
* define `nimVersion` and avoid needing -d:nimVersion140 * fix changelog
This commit is contained in:
parent
162b07d72c
commit
f77dea01fd
5 changed files with 25 additions and 4 deletions
|
|
@ -894,7 +894,7 @@ proc genFieldCheck(p: BProc, e: PNode, obj: Rope, field: PSym) =
|
|||
let discIndex = rdSetElemLoc(p.config, v, u.t)
|
||||
if optTinyRtti in p.config.globalOptions:
|
||||
# not sure how to use `genEnumToStr` here
|
||||
if p.config.isDefined("nimVersion140"):
|
||||
if p.config.getStdlibVersion < (1,5,1):
|
||||
const code = "{ #raiseFieldError($1); $2} $n"
|
||||
linefmt(p, cpsStmts, code, [strLit, raiseInstr(p)])
|
||||
else:
|
||||
|
|
@ -905,7 +905,7 @@ proc genFieldCheck(p: BProc, e: PNode, obj: Rope, field: PSym) =
|
|||
let first = p.config.firstOrd(disc.sym.typ)
|
||||
let firstLit = int64Literal(cast[int](first))
|
||||
let discName = genTypeInfo(p.config, p.module, disc.sym.typ, e.info)
|
||||
if p.config.isDefined("nimVersion140"):
|
||||
if p.config.getStdlibVersion < (1,5,1):
|
||||
const code = "{ #raiseFieldError($1); $2} $n"
|
||||
linefmt(p, cpsStmts, code, [strLit, raiseInstr(p)])
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue