summaryrefslogtreecommitdiff
path: root/numpy/f2py/cfuncs.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/f2py/cfuncs.py')
-rw-r--r--numpy/f2py/cfuncs.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py
index f1ac214d4..ccbc9b0fb 100644
--- a/numpy/f2py/cfuncs.py
+++ b/numpy/f2py/cfuncs.py
@@ -543,6 +543,21 @@ cppmacros['OLDPYNUM'] = """\
#error You need to install NumPy version 0.13 or higher. See https://scipy.org/install.html
#endif
"""
+cppmacros["F2PY_THREAD_LOCAL_DECL"] = """\
+#ifndef F2PY_THREAD_LOCAL_DECL
+#if defined(_MSC_VER)
+#define F2PY_THREAD_LOCAL_DECL __declspec(thread)
+#elif defined(__STDC_VERSION__) \\
+ && (__STDC_VERSION__ >= 201112L) \\
+ && !defined(__STDC_NO_THREADS__)
+#include <threads.h>
+#define F2PY_THREAD_LOCAL_DECL thread_local
+#elif defined(__GNUC__) \\
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 4)))
+#define F2PY_THREAD_LOCAL_DECL __thread
+#endif
+#endif
+"""
################# C functions ###############
cfuncs['calcarrindex'] = """\