[Mingw-w64-public] Determine whether a mingw-w64 port of gcc is UCRT or MSVCRT

2023-11-09 Thread sisyphus
Given that I have, in my path, a mingw-w64 port of version 13.2.0 of gcc.exe, is there a gcc command that I can run to determine whether this gcc uses UCRT ? I thought that running "gcc --version" would do that - and it does for Brecht Sanders builds ... but niXman's UCRT and MSVCRT builds both re

Re: [Mingw-w64-public] [PATCH] winpthreads: Check GetModuleHandle return value before calling GetProcAddress

2023-11-09 Thread LIU Hao
在 2023-11-09 21:27, Martin Storsjö 写道: On Tue, 31 Oct 2023, Martin Storsjö wrote: In Windows Store builds with the winstorecompat library, GetModuleHandle returns null, and GetProcAddress is not documented to allow passing null. Signed-off-by: Martin Storsjö --- mingw-w64-libraries/winpthread

Re: [Mingw-w64-public] [PATCH] winpthreads: Check GetModuleHandle return value before calling GetProcAddress

2023-11-09 Thread Martin Storsjö
On Tue, 31 Oct 2023, Martin Storsjö wrote: In Windows Store builds with the winstorecompat library, GetModuleHandle returns null, and GetProcAddress is not documented to allow passing null. Signed-off-by: Martin Storsjö --- mingw-w64-libraries/winpthreads/src/clock.c | 8 +--- mingw-w64-li

Re: [Mingw-w64-public] [PATCH] crt: Add nanosrv

2023-11-09 Thread Martin Storsjö
On Thu, 2 Nov 2023, Mark Harmstone wrote: Adds the beginnings of libnanosrv.a. This isn't comprehensive, as it also ought to include some libraries not in place yet. Signed-off-by: Mark Harmstone --- mingw-w64-crt/Makefile.am| 26 ++ mingw-w64-crt/lib-common/

Re: [Mingw-w64-public] [PATCH] crt: Add windowscoreheadless_apiset

2023-11-09 Thread Martin Storsjö
On Thu, 2 Nov 2023, Mark Harmstone wrote: Signed-off-by: Mark Harmstone --- mingw-w64-crt/Makefile.am | 306 + .../lib-common/windowscoreheadless_apiset.mri | 308 ++ mingw-w64-crt/lib32/Makefile.am | 1 + mingw-w64-crt/lib64/Make

Re: [Mingw-w64-public] [PATCH] crt: Remove API sets from mincore

2023-11-09 Thread Martin Storsjö
On Thu, 2 Nov 2023, Mark Harmstone wrote: Remove API sets that shouldn't be in mincore. Checked against Windows SDK 10.0.19041.0 and 10.0.22621.0. Signed-off-by: Mark Harmstone --- mingw-w64-crt/Makefile.am| 4 mingw-w64-crt/lib-common/mincore.mri | 4 2 files changed, 8 de

Re: [Mingw-w64-public] Define __STDC_NO_THREADS__ if C11/C17 is not provided

2023-11-09 Thread Antonin Décimo
I guess GCC/glibc folks have been dealing with multiple versions of the libc installed by multiple vendors, so their "hack" was to have the stdc-predef.h header silently and automatically included if it exists. That header is responsible for defining this macro. I've found a patch in clang to suppo

Re: [Mingw-w64-public] Define __STDC_NO_THREADS__ if C11/C17 is not provided

2023-11-09 Thread Antonin Décimo
Thanks LIU Hao, these are all good points and good ideas. Thanks Alvin, that was exactly the point I was going to make. Interestingly this bug report I've just found has more-or-less all the ideas we've exchanged. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769 If it is of some interest to any

Re: [Mingw-w64-public] Define __STDC_NO_THREADS__ if C11/C17 is not provided

2023-11-09 Thread Antonin Décimo
Hi! Thanks for the reply. > I think we can add a dummy 'threads.h' that contains solely: I should be able to test this macro to choose to include `threads.h` or not, even if it is not predefined, it cannot be located in 'threads.h'. > ISO C seems to require it to be a predefined macro without in

Re: [Mingw-w64-public] Define __STDC_NO_THREADS__ if C11/C17 is not provided

2023-11-09 Thread Alvin Wong via Mingw-w64-public
Mind that Clang also does *not* currently define `__STDC_NO_THREADS__` for MinGW target. For MSVC target, this define was added in . Some of that discussion may also apply here. With glibc, apparently the compiler automatically includes `stdc-predef.h` which