summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/nim.cfg1
-rw-r--r--compiler/ropes.nim8
2 files changed, 7 insertions, 2 deletions
diff --git a/compiler/nim.cfg b/compiler/nim.cfg
index 7ed70fb5f..853a657b3 100644
--- a/compiler/nim.cfg
+++ b/compiler/nim.cfg
@@ -11,6 +11,7 @@ define:nimPreviewSlimSystem
 
 @if windows:
   cincludes: "$lib/wrappers/libffi/common"
+  tlsEmulation:off
 @end
 
 define:useStdoutAsStdmsg
diff --git a/compiler/ropes.nim b/compiler/ropes.nim
index 3a2fbe44e..b84cfad52 100644
--- a/compiler/ropes.nim
+++ b/compiler/ropes.nim
@@ -86,8 +86,12 @@ proc newRope(data: string = ""): Rope =
   result.L = -data.len
   result.data = data
 
-var
-  cache {.threadvar.} : array[0..2048*2 - 1, Rope]
+when compileOption("tlsEmulation"): # fixme: be careful if you want to make ropes support multiple threads
+  var
+    cache: array[0..2048*2 - 1, Rope]
+else:
+  var
+    cache {.threadvar.} : array[0..2048*2 - 1, Rope]
 
 proc resetRopeCache* =
   for i in low(cache)..high(cache):