I just tested this with the ruby_3_4 branch. It's failing with:
../ruby/win32/win32.c:4795:1: error: redefinition of 'clock_gettime'
4795 | clock_gettime(clockid_t clock_id, struct timespec *sp)
| ^~~~~~~~~~~~~
In file included from C:/msys64/ucrt64/include/time.h:323,
from C:/msys64/ucrt64/include/iptypes.h:16,
from C:/msys64/ucrt64/include/iphlpapi.h:17,
from ../ruby/include/ruby/win32.h:40,
from ../ruby/include/ruby/internal/dosish.h:38,
from ../ruby/include/ruby/defines.h:78,
from ../ruby/include/ruby/ruby.h:25,
from ../ruby/win32/win32.c:24:
C:/msys64/ucrt64/include/pthread_time.h:111:35: note: previous definition of 'clock_gettime' with type 'int(clockid_t, struct timespec *)' {aka 'int(int, struct timespec *)'}
111 | WINPTHREAD_CLOCK_DECL int __cdecl clock_gettime(clockid_t clock_id, struct timespec *tp)
| ^~~~~~~~~~~~~
../ruby/win32/win32.c:4835:1: error: redefinition of 'clock_getres'
4835 | clock_getres(clockid_t clock_id, struct timespec *sp)
| ^~~~~~~~~~~~
C:/msys64/ucrt64/include/pthread_time.h:100:35: note: previous definition of 'clock_getres' with type 'int(clockid_t, struct timespec *)' {aka 'int(int, struct timespec *)'}
100 | WINPTHREAD_CLOCK_DECL int __cdecl clock_getres(clockid_t clock_id, struct timespec *res)
Can this be backported to 3.4, 3.3, & 3.2, similar to the gcc 15 fix?