]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Define which threading model is in use on Windows
authorTheShermanTanker <tanksherman27@gmail.com>
Mon, 27 May 2024 04:57:33 +0000 (12:57 +0800)
committerJonathan Yong <10walls@gmail.com>
Mon, 27 May 2024 09:24:33 +0000 (09:24 +0000)
gcc:
* config/mingw/mingw32.h: Add new define for POSIX
threads.

Signed-off-by: TheShermanTanker <tanksherman27@gmail.com>
gcc/config/mingw/mingw32.h

index 08f1b5f069676be24ff1710a016af11aad2b8795..fa6e307476ca410a100d24f9457649828971331b 100644 (file)
@@ -34,8 +34,12 @@ along with GCC; see the file COPYING3.  If not see
         | MASK_STACK_PROBE | MASK_ALIGN_DOUBLE \
         | MASK_MS_BITFIELD_LAYOUT)
 
-#ifndef TARGET_USING_MCFGTHREAD
-#define TARGET_USING_MCFGTHREAD  0
+#ifdef TARGET_USING_MCFGTHREAD
+#define DEFINE_THREAD_MODEL  builtin_define ("__USING_MCFGTHREAD__");
+#elif defined(TARGET_USE_PTHREAD_BY_DEFAULT)
+#define DEFINE_THREAD_MODEL  builtin_define ("__USING_POSIXTHREAD__");
+#else
+#define DEFINE_THREAD_MODEL
 #endif
 
 /* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS
@@ -56,8 +60,7 @@ along with GCC; see the file COPYING3.  If not see
          builtin_define_std ("WIN64");                         \
          builtin_define ("_WIN64");                            \
        }                                                       \
-      if (TARGET_USING_MCFGTHREAD)                             \
-       builtin_define ("__USING_MCFGTHREAD__");                \
+      DEFINE_THREAD_MODEL                                      \
     }                                                          \
   while (0)
 
@@ -190,7 +193,7 @@ along with GCC; see the file COPYING3.  If not see
 #else
 #define SHARED_LIBGCC_SPEC " -lgcc "
 #endif
-#if TARGET_USING_MCFGTHREAD
+#ifdef TARGET_USING_MCFGTHREAD
 #define MCFGTHREAD_SPEC  " -lmcfgthread -lkernel32 -lntdll "
 #else
 #define MCFGTHREAD_SPEC  ""