C sources regenerated for new len(openarray) header that catches more bugs; symbol files should work again

This commit is contained in:
Araq
2012-01-03 00:21:12 +01:00
parent d32a1e9ba2
commit bcbfa3aaa4
5 changed files with 18 additions and 13 deletions

View File

@@ -309,15 +309,12 @@ proc newSeq*[T](s: var seq[T], len: int) {.magic: "NewSeq", noSideEffect.}
## This is equivalent to ``s = @[]; setlen(s, len)``, but more
## efficient since no reallocation is needed.
when defined(newOpenArrayLen):
proc len*[T: openArray](x: T): int {.magic: "LengthOpenArray", noSideEffect.}
else:
proc len*[T](x: openArray[T]): int {.magic: "LengthOpenArray", noSideEffect.}
proc len*[T: openArray](x: T): int {.magic: "LengthOpenArray", noSideEffect.}
proc len*(x: string): int {.magic: "LengthStr", noSideEffect.}
proc len*(x: cstring): int {.magic: "LengthStr", noSideEffect.}
proc len*[I, T](x: array[I, T]): int {.magic: "LengthArray", noSideEffect.}
proc len*[T](x: seq[T]): int {.magic: "LengthSeq", noSideEffect.}
## returns the length of an array, a sequence or a string.
## returns the length of an array, an openarray, a sequence or a string.
## This is rougly the same as ``high(T)-low(T)+1``, but its resulting type is
## always an int.