mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 13:30:33 +00:00
attempt to fix bootstrapping; refs #3139
This commit is contained in:
@@ -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:
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user