summaryrefslogtreecommitdiff
path: root/src/_perthread.h
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-12 13:20:36 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-12 13:20:36 -0400
commitc53a55b6db53de6691660483e1a5d695a43ac090 (patch)
treee1d69801a6a3c55c187a17d4fc4e042e57233619 /src/_perthread.h
parent11d0cc5d2a1dbdd8eaf42e866503f31f90263c69 (diff)
add macro for use where thread local storage is required
Diffstat (limited to 'src/_perthread.h')
-rw-r--r--src/_perthread.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/_perthread.h b/src/_perthread.h
new file mode 100644
index 00000000..5559bb60
--- /dev/null
+++ b/src/_perthread.h
@@ -0,0 +1,11 @@
+#ifndef ___PERTHREAD_H__
+#define ___PERTHREAD_H__
+
+#if defined __STDC_VERSION__ && 201112L <= __STDC_VERSION__ && !defined __STDC_N
+O_THREADS__
+#define THREAD_LOCAL static _Thread_local
+#else
+#define THREAD_LOCAL static
+#endif
+
+#endif