attempt to fix bootstrapping; refs #3139
This commit is contained in:
parent
c733b3181e
commit
87815cbdf7
2 changed files with 4 additions and 1 deletions
|
|
@ -90,3 +90,4 @@ proc initDefines*() =
|
|||
defineSymbol("nimnode")
|
||||
defineSymbol("nimnomagic64")
|
||||
defineSymbol("nimvarargstyped")
|
||||
defineSymbol("nimtypedescfixed")
|
||||
|
|
|
|||
|
|
@ -572,12 +572,14 @@ proc unsafeNew*[T](a: var ref T, size: Natural) {.magic: "New", noSideEffect.}
|
|||
## purposes when you know what you're doing!
|
||||
|
||||
proc sizeof*[T](x: T): int {.magic: "SizeOf", noSideEffect.}
|
||||
proc sizeof*(x: typedesc): int {.magic: "SizeOf", noSideEffect.}
|
||||
## returns the size of ``x`` in bytes. Since this is a low-level proc,
|
||||
## its usage is discouraged - using ``new`` for the most cases suffices
|
||||
## that one never needs to know ``x``'s size. As a special semantic rule,
|
||||
## ``x`` may also be a type identifier (``sizeof(int)`` is valid).
|
||||
|
||||
when defined(nimtypedescfixed):
|
||||
proc sizeof*(x: typedesc): int {.magic: "SizeOf", noSideEffect.}
|
||||
|
||||
proc `<`*[T](x: Ordinal[T]): T {.magic: "UnaryLt", noSideEffect.}
|
||||
## unary ``<`` that can be used for nice looking excluding ranges:
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue