Message ID | CAP2b4GMnAWjh+GNWrJ45xyown5GTiNxhp-UXMp=hfGQNPJah_A@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | Define which threading model is in use on Windows | expand |
Hi all, Here is the v2 version of this patch. Thanks for your patience. I believe I have fixed the issue with the extra space this time around, and have also cleaned up the patch a bit. Do note that I still do not have write access and need help pushing this when this passes review best regards, Julian gcc/config/mingw/ChangeLog: * mingw32.h: Add new define for POSIX threads From 76d586f595d72c22bb5cc7648f4636709411d4cd Mon Sep 17 00:00:00 2001 From: TheShermanTanker <tanksherman27@gmail.com> Date: Mon, 27 May 2024 12:57:33 +0800 Subject: [PATCH] Define which threading model is in use on Windows Signed-off-by: TheShermanTanker <tanksherman27@gmail.com> --- 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 ""
diff --git a/gcc/config/mingw/mingw32.h b/gcc/config/mingw/mingw32.h index 08f1b5f0696..6da57aa1b89 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_PTHREAD__") +#else +#define DEFINE_THREAD_MODEL ((void) 0) #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 ""