https://gcc.gnu.org/g:f6c5f836df44196a7cd3b206af5bb29df6c7c225

commit r15-849-gf6c5f836df44196a7cd3b206af5bb29df6c7c225
Author: TheShermanTanker <tanksherma...@gmail.com>
Date:   Mon May 27 12:57:33 2024 +0800

    Define which threading model is in use on Windows
    
    gcc:
            * config/mingw/mingw32.h: Add new define for POSIX
            threads.
    
    Signed-off-by: TheShermanTanker <tanksherma...@gmail.com>

Diff:
---
 gcc/config/mingw/mingw32.h | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gcc/config/mingw/mingw32.h b/gcc/config/mingw/mingw32.h
index 08f1b5f0696..fa6e307476c 100644
--- a/gcc/config/mingw/mingw32.h
+++ b/gcc/config/mingw/mingw32.h
@@ -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  ""

Reply via email to