Skip to content

Commit

Permalink
Merge pull request #18357 from charris/backport-18180
Browse files Browse the repository at this point in the history
BUG: threads.h existence test requires GLIBC > 2.12.
  • Loading branch information
charris committed Feb 7, 2021
2 parents b66f57a + 45a6ec0 commit 224a34b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion numpy/f2py/cfuncs.py
Expand Up @@ -549,7 +549,12 @@
#define F2PY_THREAD_LOCAL_DECL __declspec(thread)
#elif defined(__STDC_VERSION__) \\
&& (__STDC_VERSION__ >= 201112L) \\
&& !defined(__STDC_NO_THREADS__)
&& !defined(__STDC_NO_THREADS__) \\
&& (!defined(__GLIBC__) || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 12))
/* __STDC_NO_THREADS__ was first defined in a maintenance release of glibc 2.12,
see https://lists.gnu.org/archive/html/commit-hurd/2012-07/msg00180.html,
so `!defined(__STDC_NO_THREADS__)` may give false positive for the existence
of `threads.h` when using an older release of glibc 2.12 */
#include <threads.h>
#define F2PY_THREAD_LOCAL_DECL thread_local
#elif defined(__GNUC__) \\
Expand Down

0 comments on commit 224a34b

Please sign in to comment.