diff options
-rw-r--r-- | compiler/semgnrc.nim | 2 | ||||
-rw-r--r-- | examples/talk/hoisting.nim | 2 | ||||
-rw-r--r-- | lib/posix/posix.nim | 10 | ||||
-rw-r--r-- | lib/system.nim | 2 |
4 files changed, 7 insertions, 9 deletions
diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index 13941fa58..2601f05ac 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -243,7 +243,7 @@ proc semGenericStmt(c: PContext, n: PNode, elif fn.kind == nkDotExpr: result.sons[0] = fuzzyLookup(c, fn, flags, ctx, mixinContext) first = 1 - # Consider 'when defined(globalsSlot): ThreadVarSetValue(globalsSlot, ...)' + # Consider 'when declared(globalsSlot): ThreadVarSetValue(globalsSlot, ...)' # in threads.nim: the subtle preprocessing here binds 'globalsSlot' which # is not exported and yet the generic 'threadProcWrapper' works correctly. let flags = if mixinContext: flags+{withinMixin} else: flags diff --git a/examples/talk/hoisting.nim b/examples/talk/hoisting.nim index df13ba2cb..54e00884f 100644 --- a/examples/talk/hoisting.nim +++ b/examples/talk/hoisting.nim @@ -14,7 +14,7 @@ template optRe{re(x)}(x: string{lit}): Regex = g template `=~`(s: string, pattern: Regex): bool = - when not definedInScope(matches): + when not declaredInScope(matches): var matches {.inject.}: array[maxSubPatterns, string] match(s, pattern, matches) diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index 52bef6de4..845496756 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -1732,12 +1732,10 @@ when hasSpawnH: when defined(linux): # better be safe than sorry; Linux has this flag, macosx doesn't, don't # know about the other OSes - when defined(tcc): - # TCC doesn't define __USE_GNU, so we can't get the magic number from - # spawn.h - const POSIX_SPAWN_USEVFORK* = cint(0x40) - else: - var POSIX_SPAWN_USEVFORK* {.importc, header: "<spawn.h>".}: cint + + # Non-GNU systems like TCC and musl-libc don't define __USE_GNU, so we + # can't get the magic number from spawn.h + const POSIX_SPAWN_USEVFORK* = cint(0x40) else: # macosx lacks this, so we define the constant to be 0 to not affect # OR'ing of flags: diff --git a/lib/system.nim b/lib/system.nim index b86ab7080..accc2ef25 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -124,7 +124,7 @@ proc declared*(x: expr): bool {.magic: "Defined", noSideEffect.} ## feature or not: ## ## .. code-block:: Nim - ## when not defined(strutils.toUpper): + ## when not declared(strutils.toUpper): ## # provide our own toUpper proc here, because strutils is ## # missing it. |