+extern int glthread_in_use();
+
+#if !defined c11_threads_in_use
+# if HAVE_THREADS_H && USE_POSIX_THREADS_FROM_LIBC
+# define c11_threads_in_use 1
+# elif HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use (thrd_exit != NULL)
+# else
+# define c11_threads_in_use 0
+# endif
+#endif
+
+#if PTHREAD_IN_USE_DETECTION_HARD
+# define pthread_in_use glthread_in_use()
+#elif USE_POSIX_THREADS_WEAK
+# pragma weak pthread_mutexattr_gettype
+# define pthread_in_use (pthread_mutexattr_gettype || c11_threads_in_use)
+#else
+# define pthread_in_use 1
+#endif
+