From a4ac8ee16d3ad0b56ec2b18eea850495efec908a Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Tue, 1 Oct 2024 12:31:28 -0600 Subject: [PATCH] Work around OSX not supporting threads.h. --- include/qt_macros.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/qt_macros.h b/include/qt_macros.h index 541920c32..0f13573e7 100644 --- a/include/qt_macros.h +++ b/include/qt_macros.h @@ -1,7 +1,16 @@ #ifndef QT_MACROS_H #define QT_MACROS_H +// Work around OSX currently refusing to support threads.h +#if 201112L <= __STDC_VERSION__ && __STDC_VERSION__ < 202311L +#ifndef __STDC_NO_THREADS__ #include +#else +#define thread_local _Thread_local +#endif +#elif __STDC_VERSION__ < 201112L +#error "C11 is required" +#endif #ifdef HAVE_CONFIG_H #include