Closed brechtsanders closed 1 year ago
@brechtsanders Even in MinGW, the Windows API functions are still available, right? I really don't want to special-case this as MinGW isn't a platform/toolset I support or use.
MinGW provides Windows API functions, and additionally a subset of POSIX (e.g. pthreads).
The fact that you already treat gmtime_r
and localtime_r
differently for Windows is sort of the issue, as recent MinGW-w64 (not sure about old MinGW) also define these (when _POSIX_THREAD_SAFE_FUNCTIONS
is defined).
Sorry, I'm not going to special-case MingW support for HTMLDOC.
The issue still exists in 5.5.3, but when building current master for win64 it succeeds.
When building for Windows with recent MinGW-w64 (e.g. GCC12 from https://winlibs.com/)
gmtime_r
andlocaltime_r
are actually available if_POSIX_THREAD_SAFE_FUNCTIONS
is defined.There is some code that addresses previously missing functions in MinGW, like
define localtime_r(t,tm) localtime_s(tm,t)
inhtmldoc/zipc.c
, but it would be better to guard this code with#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
.Maybe
configure
can also be fixed to detect ifgmtime_r
andlocaltime_r
are available in MinGW-w64 of_POSIX_THREAD_SAFE_FUNCTIONS
is defined.