Compilation in MSYS2/MinGW with GCC 13.1 fails: 'struct _stat32' has no member named 'st_mtim'
The media-autobuild suite compiles librist as part of ffmpeg modules to be linked. This worked until about July 3rd. Yesterday it started failing, one reason was a probable change in meson options, another a possibly typo.
https://github.com/m-ab-s/media-autobuild_suite/issues/2476
CPPFLAGS: -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1
CFLAGS: -fstack-protector-strong -mtune=generic -O2 -pipe -mthreads
CXXFLAGS: -fstack-protector-strong -mtune=generic -O2 -pipe -mthreads
LDFLAGS: -pipe -static-libgcc -fstack-protector-strong -static-libstdc++
ninja -j4
...
[2/16] Compiling C object tools/ristsender.exe.p/srp_shared.c.obj
FAILED: tools/ristsender.exe.p/srp_shared.c.obj
"gcc.bat" "-Itools/ristsender.exe.p" "-Itools" "-I../tools" "-I." "-I.." "-I../src" "-Iinclude/librist" "-I../include/librist" "-Iinclude" "-I../include" "-Icontrib" "-I../contrib" "-fdiagnostics-color=always" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-Wextra" "-Wpedantic" "-std=c99" "-O3" "-DWIN32_LEAN_AND_MEAN" "-D_CRT_NONSTDC_NO_DEPRECATE" "-D_CRT_SECURE_NO_WARNINGS" "-fvisibility=hidden" "-fstack-protector-strong" "-mtune=generic" "-O2" "-pipe" "-mthreads" "-D_FORTIFY_SOURCE=2" "-D__USE_MINGW_ANSI_STDIO=1" "-pthread" -MD -MQ tools/ristsender.exe.p/srp_shared.c.obj -MF "tools/ristsender.exe.p/srp_shared.c.obj.d" -o tools/ristsender.exe.p/srp_shared.c.obj "-c" ../tools/srp_shared.c
../tools/srp_shared.c:24: warning: "stat" redefined
24 | #define stat _stat
|
In file included from ../tools/srp_shared.c:21:
G:/MABS/msys64/mingw32/include/sys/stat.h:276: note: this is the location of the previous definition
276 | #define stat _stat32i64
|
../tools/srp_shared.c: In function 'user_verifier_lookup':
../tools/srp_shared.c:156:28: error: 'struct _stat32' has no member named 'st_mtim'; did you mean 'st_mtime'?
156 | *generation = (buf.st_mtim.tv_sec << 32) | buf.st_mtim.tv_nsec;
| ^~~~~~~
| st_mtime
../tools/srp_shared.c:156:56: error: 'struct _stat32' has no member named 'st_mtim'; did you mean 'st_mtime'?
156 | *generation = (buf.st_mtim.tv_sec << 32) | buf.st_mtim.tv_nsec;
| ^~~~~~~
| st_mtime
ninja: build stopped: subcommand failed.
logs.zip collected by media-autobuild suite after compilation failed.