make nim bootstrap again for older versions
This commit is contained in:
parent
8f457f6ebb
commit
a8edf67a28
6 changed files with 14 additions and 6 deletions
|
|
@ -98,3 +98,4 @@ proc initDefines*() =
|
|||
defineSymbol("nimtypedescfixed")
|
||||
defineSymbol("nimKnowsNimvm")
|
||||
defineSymbol("nimArrIdx")
|
||||
defineSymbol("nimImmediateDeprecated")
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
## **Note**: This interface will change as soon as the compiler supports
|
||||
## closures and proper coroutines.
|
||||
|
||||
include "system/inclrtl"
|
||||
|
||||
when not defined(nimhygiene):
|
||||
{.pragma: dirty.}
|
||||
|
||||
|
|
@ -456,7 +458,7 @@ template anyIt*(seq1, pred: untyped): bool =
|
|||
break
|
||||
result
|
||||
|
||||
template toSeq*(iter: untyped): untyped =
|
||||
template toSeq*(iter: untyped): untyped {.oldimmediate.} =
|
||||
## Transforms any iterator into a sequence.
|
||||
##
|
||||
## Example:
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ template addImpl(enlarge) {.dirty.} =
|
|||
rawInsert(t, t.data, key, val, hc, j)
|
||||
inc(t.counter)
|
||||
|
||||
template maybeRehashPutImpl(enlarge) {.dirty.} =
|
||||
template maybeRehashPutImpl(enlarge) {.oldimmediate, dirty.} =
|
||||
if mustRehash(t.dataLen, t.counter):
|
||||
enlarge(t)
|
||||
index = rawGetKnownHC(t, key, hc)
|
||||
|
|
@ -87,7 +87,7 @@ template maybeRehashPutImpl(enlarge) {.dirty.} =
|
|||
rawInsert(t, t.data, key, val, hc, index)
|
||||
inc(t.counter)
|
||||
|
||||
template putImpl(enlarge) {.dirty.} =
|
||||
template putImpl(enlarge) {.oldimmediate, dirty.} =
|
||||
var hc: Hash
|
||||
var index = rawGet(t, key, hc)
|
||||
if index >= 0: t.data[index].val = val
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ proc clear*[A, B](t: OrderedTable[A, B] | OrderedTableRef[A, B]) =
|
|||
t.first = -1
|
||||
t.last = -1
|
||||
|
||||
template forAllOrderedPairs(yieldStmt: untyped) {.dirty.} =
|
||||
template forAllOrderedPairs(yieldStmt: untyped) {.oldimmediate, dirty.} =
|
||||
var h = t.first
|
||||
while h >= 0:
|
||||
var nxt = t.data[h].next
|
||||
|
|
@ -649,7 +649,7 @@ proc len*[A, B](t: OrderedTableRef[A, B]): int {.inline.} =
|
|||
## returns the number of keys in `t`.
|
||||
result = t.counter
|
||||
|
||||
template forAllOrderedPairs(yieldStmt: untyped) {.dirty.} =
|
||||
template forAllOrderedPairs(yieldStmt: untyped) {.oldimmediate, dirty.} =
|
||||
var h = t.first
|
||||
while h >= 0:
|
||||
var nxt = t.data[h].next
|
||||
|
|
|
|||
|
|
@ -1874,7 +1874,7 @@ iterator countdown*[T](a, b: T, step = 1): T {.inline.} =
|
|||
yield res
|
||||
dec(res, step)
|
||||
|
||||
template countupImpl(incr: untyped) {.dirty.} =
|
||||
template countupImpl(incr: untyped) {.oldimmediate, dirty.} =
|
||||
when T is IntLikeForCount:
|
||||
var res = int(a)
|
||||
while res <= int(b):
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@
|
|||
when not defined(nimNewShared):
|
||||
{.pragma: gcsafe.}
|
||||
|
||||
when not defined(nimImmediateDeprecated):
|
||||
{.pragma: oldimmediate, immediate.}
|
||||
else:
|
||||
{.pragma: oldimmediate.}
|
||||
|
||||
when defined(createNimRtl):
|
||||
when defined(useNimRtl):
|
||||
{.error: "Cannot create and use nimrtl at the same time!".}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue