[Mingw-w64-public] winpthreads: fix compiling C++ modules

2025-06-21 Thread Kirill Makurin
This should fix error when compiling C++ modules[1]. - Kirill Makurin [1] https://github.com/mingw-w64/mingw-w64/issues/99 From c3d9c047a80ee40545388a0359f25fa3d1f4a95e Mon Sep 17 00:00:00 2001 From: Kirill Makurin Date: Sun, 22 Jun 2025 04:01:04 +0900 Subject: [PATCH] winpthreads: fix compiling

Re: [Mingw-w64-public] [PATCH 02/10] crt: Define fseeko and ftello symbols as aliases to fseek and ftell

2025-06-21 Thread Pali Rohár
On Saturday 21 June 2025 13:47:12 Martin Storsjö wrote: > On Fri, 20 Jun 2025, Pali Rohár wrote: > > > On Thursday 19 June 2025 20:52:59 Martin Storsjö wrote: > > > On Sun, 15 Jun 2025, Pali Rohár wrote: > > > > > > > Both msvcrt and UCRT ABI uses for off_t-based function without any > > > > suf

[Mingw-w64-public] [PATCH 1/4] crt: Check for underflow in *stat32i64 functions

2025-06-21 Thread Pali Rohár
msvcrt *stat32* functions do not work for time before year 1970. Add similar underflow checks into mingw-w64 emulations. --- mingw-w64-crt/stdio/_fstat32i64.c | 6 +++--- mingw-w64-crt/stdio/_stat32i64.c | 6 +++--- mingw-w64-crt/stdio/_wstat32i64.c | 6 +++--- 3 files changed, 9 insertions(+), 9

[Mingw-w64-public] [PATCH 2/4] crt: Provide emulation of _fstat32, _stat32 and _wstat32 functions for 64-bit msvcrt builds

2025-06-21 Thread Pali Rohár
All 64-bit CRT libraries except the msvcrt.dll provides native _fstat32, _stat32 and _wstat32 functions. 64-bit system os msvcrt.dll is an exception and does not contain these function. So implement mingw-w64 emulation of these functions via the 64-bit variants of stat functions. Reported issue: h

[Mingw-w64-public] [PATCH 4/4] crt: Add testcases for all _fstat*, _stat* and _wstat* functions

2025-06-21 Thread Pali Rohár
This will check that of those functions can be compiled, linked and at runtime can be resolved from CRT DLL library. --- mingw-w64-crt/Makefile.am | 5 +- mingw-w64-crt/testcases/t__fstat_all.c | 100 mingw-w64-crt/testcases/t__stat_all.c | 100

[Mingw-w64-public] [PATCH 0/3] crt: Improve LFS 64-bit functions (part 2)

2025-06-21 Thread Pali Rohár
Additional changes for "crt: Improve LFS 64-bit functions" series. Should be applied on top of them. Pali Rohár (3): headers: Add missing __cdecl for fopen64() function headers: Declare missing open64(), freopen64() and tmpfile64() functions crt: Add testcases for lfs functions mingw-w

[Mingw-w64-public] [PATCH] crt: Fix compilation of libscrnsavw.a

2025-06-21 Thread Pali Rohár
Setting the lib32_libscrnsavw_a_CFLAGS variable automatically turns off usage of AM_CFLAGS variable for that target. As the AM_CFLAGS contains the mingw-w64 CRT build flags, specify it manually in lib32_libscrnsavw_a_CFLAGS variable. Do same for all architectures. --- mingw-w64-crt/Makefile.am | 8

[Mingw-w64-public] [PATCH] crt: Check for underflow in _lseeki64() and fsetpos() functions

2025-06-21 Thread Pali Rohár
--- mingw-w64-crt/stdio/_lseeki64.c | 2 +- mingw-w64-crt/stdio/fsetpos.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/stdio/_lseeki64.c b/mingw-w64-crt/stdio/_lseeki64.c index 2408a6cfb6eb..6ead4a98e182 100644 --- a/mingw-w64-crt/stdio/_lseeki64.c +++ b/m

[Mingw-w64-public] [PATCH 0/4] crt: Fix _*stat32 and _*stat32i64 functions for 64-bit msvcrt.dll builds

2025-06-21 Thread Pali Rohár
This patch series adds _fstat32, _stat32, _wstat32, _fstat32i64, _stat32i64 and _wstat32i64 function emulation for 64-bit msvcrt.dll builds as the msvcrt.dll is missing those functions. Last change adds a compile time test which ensures that all _fstat*, _stat* and _wstat* functions can be used in

[Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-21 Thread Pali Rohár
AM_CFLAGS contains cflags required to build the mingw-w64 CRT source code. They are not intended to compile applications (including those used in mingw-w64 testsuite). Setting per-target _CFLAGS variable overwrites the AM_CFLAGS. So for every testcase sets the custom _CFLAGS variable. This ensures

[Mingw-w64-public] [PATCH 3/4] crt: Provide emulation of _fstat32i64, _stat32i64 and _wstat32i64 functions for 64-bit msvcrt builds

2025-06-21 Thread Pali Rohár
All 64-bit CRT libraries except the msvcrt.dll provides native _fstat32i64, _stat32i64 and _wstat32i64 functions. 64-bit system os msvcrt.dll is an exception and does not contain these function. mingw-w64 already contains emulation of these functions for pre-msvcrt40 32-bit builds. Extend this emu

[Mingw-w64-public] [PATCH 2/3] headers: Declare missing open64(), freopen64() and tmpfile64() functions

2025-06-21 Thread Pali Rohár
--- mingw-w64-headers/crt/io.h| 1 + mingw-w64-headers/crt/stdio.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mingw-w64-headers/crt/io.h b/mingw-w64-headers/crt/io.h index a6dc2f8a1bb2..ac049e7c5cde 100644 --- a/mingw-w64-headers/crt/io.h +++ b/mingw-w64-headers/crt/io.h @@ -353,6

[Mingw-w64-public] [PATCH 3/3] crt: Add testcases for lfs functions

2025-06-21 Thread Pali Rohár
This will check that of those functions can be compiled, linked and at runtime can be resolved from CRT DLL library. --- mingw-w64-crt/Makefile.am | 1 + mingw-w64-crt/testcases/t_lfs.c | 29 + 2 files changed, 30 insertions(+) create mode 100644 mingw-w64-crt/t

[Mingw-w64-public] [PATCH 1/3] headers: Add missing __cdecl for fopen64() function

2025-06-21 Thread Pali Rohár
--- mingw-w64-headers/crt/stdio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h index 89ce689cceb3..1cd6edc7a102 100644 --- a/mingw-w64-headers/crt/stdio.h +++ b/mingw-w64-headers/crt/stdio.h @@ -569,7 +569,7 @@ in

Re: [Mingw-w64-public] [PATCH 02/10] crt: Define fseeko and ftello symbols as aliases to fseek and ftell

2025-06-21 Thread Martin Storsjö
On Fri, 20 Jun 2025, Pali Rohár wrote: On Thursday 19 June 2025 20:52:59 Martin Storsjö wrote: On Sun, 15 Jun 2025, Pali Rohár wrote: Both msvcrt and UCRT ABI uses for off_t-based function without any suffix in their name the 32-bit long off_t type for both 32-bit and 64-bit architectures.