mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-24 00:05:25 +00:00
bugfix: compiler errors for explicit initialization of thread local variables; os.nim does not rely on it anymore
This commit is contained in:
@@ -694,8 +694,8 @@ proc execShellCmd*(command: string): int {.rtl, extern: "nos$1".} =
|
||||
# iterator depends on ``environment``.
|
||||
|
||||
var
|
||||
envComputed {.threadvar.}: bool = false
|
||||
environment {.threadvar.}: seq[string] = @[]
|
||||
envComputed {.threadvar.}: bool
|
||||
environment {.threadvar.}: seq[string]
|
||||
|
||||
when defined(windows):
|
||||
# because we support Windows GUI applications, things get really
|
||||
@@ -705,6 +705,7 @@ when defined(windows):
|
||||
|
||||
proc getEnvVarsC() =
|
||||
if not envComputed:
|
||||
environment = @[]
|
||||
var
|
||||
env = getEnvironmentStringsA()
|
||||
e = env
|
||||
@@ -738,6 +739,7 @@ else:
|
||||
proc getEnvVarsC() =
|
||||
# retrieves the variables of char** env of C's main proc
|
||||
if not envComputed:
|
||||
environment = @[]
|
||||
when useNSGetEnviron:
|
||||
var gEnv = NSGetEnviron()[]
|
||||
var i = 0
|
||||
|
||||
Reference in New Issue
Block a user