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 ###################################################################### 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 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