From a1caf26b4142f1c14d49266ec846a2f178f5b13a Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 14 May 2026 15:08:30 -0500 Subject: [PATCH 1/3] fix: remove GetTickCount64() def in libutils/platform.h to work with newer mingw-w64 version 13 Ticket: CFE-4401 --- libutils/platform.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libutils/platform.h b/libutils/platform.h index ccd3a2bb..48deb618 100644 --- a/libutils/platform.h +++ b/libutils/platform.h @@ -191,10 +191,6 @@ struct utsname # define IPV6_V6ONLY 27 # endif -// Not available in MinGW headers unless you raise WINVER and _WIN32_WINNT, but -// that is very badly supported in MinGW ATM. -ULONGLONG WINAPI GetTickCount64(void); - #else /* !__MINGW32__ */ # include #endif From cd072ddeacfb249b0d04b773385f1a96cb46d7fe Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 14 May 2026 16:22:47 -0500 Subject: [PATCH 2/3] Added check for clock_gettime in pthread library for the case of mingw build Ticket: CFE-4401 --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 2e6262fb..04a6ab31 100644 --- a/configure.ac +++ b/configure.ac @@ -496,6 +496,7 @@ dnl ###################################################################### AC_CHECK_LIB(m, sqrt) AC_CHECK_LIB(rt, clock_gettime) +AC_CHECK_LIB(pthread, clock_gettime) AC_CHECK_LIB(dl, dlopen) dnl ###################################################################### From a565bf6a54107a9b0e2c64094a775af70bee021c Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 14 May 2026 16:35:15 -0500 Subject: [PATCH 3/3] Adjusted signal_lib.h for mingw platform Ticket: CFE-4401 Changelog: none --- libutils/signal_lib.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libutils/signal_lib.h b/libutils/signal_lib.h index 35a1752e..069abe85 100644 --- a/libutils/signal_lib.h +++ b/libutils/signal_lib.h @@ -1,3 +1,15 @@ +#include + +#ifndef CFENGINE_SIGNAL_LIB_H +#define CFENGINE_SIGNAL_LIB_H + +/** + * from pthreads-w32 pthread_kill manpage + * Pthreads-w32 does not implement signals yet and so these routines have almost no use except to prevent the compiler or linker from complaining. + * So on Windows pthreads-w32 there is no sigemptyset() or sigaddset() and pthread_sigmask() is essentially a no-op, so skip it. + */ +#ifndef __MINGW32__ + static inline void MaskTerminationSignalsInThread() { /* Mask termination signals in a thread so that they always end up in the @@ -13,3 +25,5 @@ static inline void MaskTerminationSignalsInThread() ret = pthread_sigmask(SIG_BLOCK, &th_sigset, NULL); assert(ret == 0); } +#endif +#endif