From 968d9584ffd41dc8eb32e333372e56ad31fe4f92 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 2 Nov 2022 16:50:35 -0700 Subject: [PATCH] IPC: allow QSystemSemaphorePosix to build on Windows The MinGW-provided winpthreads has and the necessary functions, though the source seems to implement sem_open() as an unconditional errno = ENOSYS; return SEM_FAIL; But in case they actually implement it, we enable support. Change-Id: I3d74c753055744deb8acfffd1723e982d05651b5 Reviewed-by: Fabian Kosmale --- src/corelib/ipc/qsystemsemaphore_posix.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/corelib/ipc/qsystemsemaphore_posix.cpp b/src/corelib/ipc/qsystemsemaphore_posix.cpp index 257a571d51..a5765c5da8 100644 --- a/src/corelib/ipc/qsystemsemaphore_posix.cpp +++ b/src/corelib/ipc/qsystemsemaphore_posix.cpp @@ -17,7 +17,13 @@ #include #include -#include "private/qcore_unix_p.h" +#ifdef Q_OS_UNIX +# include "private/qcore_unix_p.h" +#else +#define EINTR_LOOP_VAL(var, val, cmd) \ + (void)var; var = cmd +#define EINTR_LOOP(var, cmd) EINTR_LOOP_VAL(var, -1, cmd) +#endif // OpenBSD 4.2 doesn't define EIDRM, see BUGS section: // http://www.openbsd.org/cgi-bin/man.cgi?query=semop&manpath=OpenBSD+4.2