[Mingw-w64-public] winpthreads: declaration of pid_t and autoconf's AC_TYPE_PID_T

2025-06-15 Thread Kirill Makurin
I think it is worth to report this issue to autoconf-bug mailing list first. I'll do it. If they will not want to fix this, we can simply ``` #ifdef pid_t #undef pid_t #endif ``` since we typedef it to the same base type as AC_TYPE_PID_T #define's it. - Kirill Makurin

[Mingw-w64-public] winpthreads: add a pkg-config file?

2025-06-15 Thread Kirill Makurin
Now that winpthreads can be built with MSVC, I think it is usable as a package on its own. Having a pkg-config file would make using winpthreads much easier with meson and cmake. For instance, with meson one could ``` If host_machine.system() == 'windows' threads = dependency('winpthreads') els

Re: [Mingw-w64-public] Inconsistent behavior of btowc with "C" locale

2025-06-15 Thread Kirill Makurin
Initially it was a simple patch to make `btowc` and `wctob` match UCRT behavior. If do serious changes to `btowc` and `wctob`, I think we should also take a look at `mb*towc*` and `wc*tomb*` functions provided by mingw-w64. I do not say and I do not think that we should replace `mb*towc*` and `

[Mingw-w64-public] widl build error on Cygwin

2025-06-15 Thread Jeremy Drake via Mingw-w64-public
I just tried to build llvm-mingw on Cygwin, as part of testing builds of llvm/clang/lld on Cygwin, and got a new error building widl: In file included from /usr/include/limits.h:13, from /usr/lib/gcc/x86_64-pc-cygwin/12/include/limits.h:203, from /usr/lib/gcc/x86_

[Mingw-w64-public] [PATCH 09/10] crt: Define LFS open64, freopen64, tmpfile64 symbols as aliases in crt-aliases.def.in

2025-06-15 Thread Pali Rohár
All these functions with suffix 64 are specified in the Large File Specification. mingw-w64 does not need anything special for them, every opened file on Windows can be used with 64-bit offset support. --- mingw-w64-crt/def-include/crt-aliases.def.in | 3 +++ mingw-w64-crt/lib-common/

[Mingw-w64-public] [PATCH 08/10] crt: Define lseek64 as alias in crt-aliases.def.in

2025-06-15 Thread Pali Rohár
--- mingw-w64-crt/Makefile.am| 2 +- mingw-w64-crt/def-include/crt-aliases.def.in | 1 + .../lib-common/api-ms-win-crt-stdio-l1-1-0.def | 1 + mingw-w64-crt/stdio/_lseeki64.c | 3 +++ mingw-w64-crt/stdio/lseek64.c

[Mingw-w64-public] [PATCH 07/10] crt: Provide _lseeki64() function for pre-msvcrt40 builds

2025-06-15 Thread Pali Rohár
Function _lseeki64() is available since msvcrt40.dll. For older CRT libraries provides emulation via lseek(). --- mingw-w64-crt/Makefile.am | 1 + mingw-w64-crt/stdio/_lseeki64.c | 22 ++ 2 files changed, 23 insertions(+) create mode 100644 mingw-w64-crt/stdio/_lseeki64

[Mingw-w64-public] [PATCH 05/10] crt: Define ftello64 symbol as alias to _ftelli64

2025-06-15 Thread Pali Rohár
mingw-w64 implementation of ftello64() and _ftelli64() functions are same. So remove the ftello64 implementation and define ftello64 symbol as an alias to the _ftelli64 symbol. This change allows to use native msvcr80+ / UCRT implementation of _ftelli64() function for the POSIX ftello64() instead

[Mingw-w64-public] [PATCH 06/10] crt: Define fopen64 symbol as alias in crt-aliases.def.in

2025-06-15 Thread Pali Rohár
--- mingw-w64-crt/Makefile.am | 1 - mingw-w64-crt/def-include/crt-aliases.def.in | 1 + .../lib-common/api-ms-win-crt-stdio-l1-1-0.def| 1 + mingw-w64-crt/stdio/fopen64.c | 11 --- 4 files changed, 2 insertions(+), 12

[Mingw-w64-public] [PATCH 10/10] headers: Deinline UCRT fseeko(), fseeko64(), ftello() and ftello64() functions

2025-06-15 Thread Pali Rohár
All those UCRT inline functions are defined just as redirects to another functions. All those functions have already defined symbols in UCRT import library (as aliases). So remove inline functions and unify them between msvcrt and UCRT builds. Add missing __cdecl and _CRTIMP keywords. --- mingw-w6

[Mingw-w64-public] [PATCH 03/10] crt: Use native _fseeki64 symbol from msvcrt.dll on Windows Vista+

2025-06-15 Thread Pali Rohár
Function _fseeki64() is available in msvcrt.dll starting from Windows Vista+. Change the emulation of the _fseeki64() function to use native symbol when available via the msvcrt_or_emu_glue.h. --- mingw-w64-crt/stdio/_fseeki64.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -

[Mingw-w64-public] [PATCH 04/10] crt: Define fseeko64 symbol as alias to _fseeki64

2025-06-15 Thread Pali Rohár
mingw-w64 implementation of fseeko64() and _fseeki64() functions in files mingw-w64-crt/stdio/_fseeki64.c and mingw-w64-crt/stdio/fseeko64.c are exactly same. Also both both fseeko64() and _fseeki64() functions have C fseek() ABI with 64-bit offset type. So remove the mingw-w64 fseeko64 implement

[Mingw-w64-public] [PATCH 00/10] crt: Improve LFS 64-bit functions

2025-06-15 Thread Pali Rohár
Remove duplicated code, unify UCRT vs msvcrt builds and allow to call native CRT functions where possible. Pali Rohár (10): crt: Add hyperlink for Large File Specification section 3.1 Transitional Extensions crt: Define fseeko and ftello symbols as aliases to fseek and ftell crt: Use nat

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

2025-06-15 Thread Pali Rohár
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. So define the fseeko symbol as alias to fseek and ftello symbol as alias to ftell symbol because the fseek and ftell also uses only 32-bit of

[Mingw-w64-public] [PATCH 01/10] crt: Add hyperlink for Large File Specification section 3.1 Transitional Extensions

2025-06-15 Thread Pali Rohár
--- mingw-w64-crt/def-include/crt-aliases.def.in | 1 + 1 file changed, 1 insertion(+) diff --git a/mingw-w64-crt/def-include/crt-aliases.def.in b/mingw-w64-crt/def-include/crt-aliases.def.in index 2c9090b9e130..de0333938dba 100644 --- a/mingw-w64-crt/def-include/crt-aliases.def.in +++ b/mingw-w

[Mingw-w64-public] [PATCH] crt: Deinline mbsinit() function

2025-06-15 Thread Pali Rohár
This simplify header declaration for mbsinit() function. --- mingw-w64-crt/Makefile.am | 1 + mingw-w64-crt/misc/mbsinit.c | 1 - mingw-w64-crt/misc/ucrt_mbsinit.c | 14 ++ mingw-w64-headers/crt/wchar.h | 10 +- 4 files changed, 16 insertions(+), 10 deletions