Le mer. 29 nov. 2023 à 12:32, Martin Storsjö <mar...@martin.st> a écrit :
>
> On Wed, 29 Nov 2023, Antonin Décimo wrote:
>
> > Signed-off-by: Antonin Décimo <anto...@tarides.com>
> > ---
> > mingw-w64-libraries/winpthreads/src/thread.c | 18 ++++++++++++++++--
> > 1 file changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
> > b/mingw-w64-libraries/winpthreads/src/thread.c
> > index 7c5e75f91..16b13b07c 100644
> > --- a/mingw-w64-libraries/winpthreads/src/thread.c
> > +++ b/mingw-w64-libraries/winpthreads/src/thread.c
> > @@ -508,11 +508,25 @@ __dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason, 
> > LPVOID lpreserved)
> >
> > /* TLS-runtime section variable.  */
> > #ifdef _MSC_VER
> > -#pragma section(".CRT$XLF", shared)
> > +# ifdef _WIN64
> > +/* .CRT section is merged with .rdata on x64 so it must be constant data. 
> > */
>
> This patch assumes that _WIN64 is enough to determine between x86 and x64,
> but does the distinction also hold up for ARM and ARM64? As current public
> MSVC releases support all these 4 architectures, I would suggest checking
> what the situation is wrt these on all 4 architectures before adding
> ifdefs like this.

Thanks for the review!

The page at Microsoft-specific predefined macros [1] has some
information about the macros.
- _WIN32 Defined as 1 when the compilation target is 32-bit ARM,
64-bit ARM, x86, or x64. Otherwise, undefined.
- _WIN64 Defined as 1 when the compilation target is 64-bit ARM or
x64. Otherwise, undefined.

There are also some arch-specific macros, such as _M_AMD64, _M_ARM64, etc.
https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170#microsoft-specific-predefined-macros

Does that answer your question?
-- Antonin


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to