summary refs log tree commit diff stats
path: root/lib/nimbase.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nimbase.h')
-rw-r--r--lib/nimbase.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/nimbase.h b/lib/nimbase.h
index daae47d65..cbd35605b 100644
--- a/lib/nimbase.h
+++ b/lib/nimbase.h
@@ -143,6 +143,10 @@ __AVR__
 #  error "Cannot define NIM_THREADVAR"
 #endif
 
+#if defined(__cplusplus)
+  #define NIM_THREAD_LOCAL thread_local
+#endif
+
 /* --------------- how int64 constants should be declared: ----------- */
 #if defined(__GNUC__) || defined(__LCC__) || \
     defined(__POCC__) || defined(__DMC__) || defined(_MSC_VER)