On Saturday 13 December 2025 00:27:32 Martin Storsjö wrote:
> On Thu, 4 Dec 2025, Pali Rohár wrote:
>
> > These 32-bit wide functions are missing only in 64-bit system OS msvcrt.dll
> > libraries. Provide mingw-w64 emulation as a simple wrapper around 64-bit
> > wide functions.
> > ---
> > mingw-w64-crt/Makefile.am | 8 ++++++++
> > mingw-w64-crt/stdio/_findfirst32.c | 19 +++++++++++++++++++
> > mingw-w64-crt/stdio/_findnext32.c | 19 +++++++++++++++++++
> > mingw-w64-crt/stdio/_wfindfirst32.c | 19 +++++++++++++++++++
> > mingw-w64-crt/stdio/_wfindnext32.c | 19 +++++++++++++++++++
> > 5 files changed, 84 insertions(+)
> > create mode 100644 mingw-w64-crt/stdio/_findfirst32.c
> > create mode 100644 mingw-w64-crt/stdio/_findnext32.c
> > create mode 100644 mingw-w64-crt/stdio/_wfindfirst32.c
> > create mode 100644 mingw-w64-crt/stdio/_wfindnext32.c
> >
> > diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
> > index 9714b855810d..ca9ec404aeae 100644
> > --- a/mingw-w64-crt/Makefile.am
> > +++ b/mingw-w64-crt/Makefile.am
> > @@ -674,11 +674,15 @@ src_msvcrt64=\
> > misc/wassert.c \
> > misc/wcsnlen.c \
> > secapi/wcstok_s.c \
> > + stdio/_findfirst32.c \
> > + stdio/_findnext32.c \
> > stdio/_fseeki64.c \
> > stdio/_fstat32.c \
> > stdio/_fstat32i64.c \
> > stdio/_stat32.c \
> > stdio/_stat32i64.c \
> > + stdio/_wfindfirst32.c \
> > + stdio/_wfindnext32.c \
> > stdio/_wstat32.c \
> > stdio/_wstat32i64.c \
> > string/msvcr80pre_wcstok.c
> > @@ -839,11 +843,15 @@ src_msvcrtarm64=\
> > misc/__initenv.c \
> > misc/__winitenv.c \
> > secapi/msvcrt_arm_wcstok_s.c \
> > + stdio/_findfirst32.c \
> > + stdio/_findnext32.c \
> > stdio/_fstat32.c \
> > stdio/_fstat32i64.c \
> > stdio/_setmaxstdio.c \
> > stdio/_stat32.c \
> > stdio/_stat32i64.c \
> > + stdio/_wfindfirst32.c \
> > + stdio/_wfindnext32.c \
> > stdio/_wstat32.c \
> > stdio/_wstat32i64.c \
> > stdio/gets.c \
> > diff --git a/mingw-w64-crt/stdio/_findfirst32.c
> > b/mingw-w64-crt/stdio/_findfirst32.c
> > new file mode 100644
> > index 000000000000..d2950d5a9367
> > --- /dev/null
> > +++ b/mingw-w64-crt/stdio/_findfirst32.c
> > @@ -0,0 +1,19 @@
> > +#include <io.h>
> > +#include <string.h>
> > +
> > +intptr_t __cdecl _findfirst32(const char *_Filename,struct _finddata32_t
> > *_FindData)
> > +{
> > + struct __finddata64_t fd;
> > + intptr_t ret = _findfirst64(_Filename,&fd);
> > + if (ret == -1)
> > + return -1;
> > + _FindData->attrib=fd.attrib;
> > + _FindData->time_create=fd.time_create;
> > + _FindData->time_access=fd.time_access;
> > + _FindData->time_write=fd.time_write;
> > + _FindData->size=(_fsize_t) fd.size;
>
> If this is newly written code (instead of some existing piece of code just
> being copypasted around), I'd appreciate some spaces around some operators
> to make this a bit more readable.
>
> // Martin
I copied the code from existing mingw-w64-crt/stdio/_findfirst64i32.c
file and adjusted it for other functions. So I did not touch the style.
I can reformat new files, this is not a problem.
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public