Windows: portability fixes for IPC, SystemAsync and MCP tests
- IPC: map poll() onto WSAPoll and link ws2_32 on Windows (the module's remaining POSIX socket surface still needs a dedicated port). - SystemAsync: define the non-ANSI SIGTERM/SIGKILL values the Windows process backend interprets itself. - MCP tests: stdio transport cases skip on Windows instead of being compiled out (the scanner cannot evaluate #if guards). - SystemAsync tests: mark the POSIX process-helper suite with @requires-posix. Refs #65
This commit is contained in:
1 parent
ea285d1c65
commit
c6ba2f42b5
6 files changed
+34
-2
No files matched your search
@@ -1,12 +1,24 @@
|
||||
#include <Void/IPC/Transport.hpp>
|
||||
|
||||
#include <fcntl.h>
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
// MinGW's winsock2.h defines struct pollfd and the POLL* flags; WSAPoll is
|
||||
// the Windows equivalent of poll(2).
|
||||
inline int poll(struct pollfd* descriptors,
|
||||
unsigned long count,
|
||||
int timeout)
|
||||
{
|
||||
return ::WSAPoll(descriptors, count, timeout);
|
||||
}
|
||||
#else
|
||||
#include <poll.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <atomic>
|
||||
#include <cerrno>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
void_add_module(IPC
|
||||
INTERNAL_DEPS Core Functional Memory Time Binary Async IO Resilience
|
||||
DEPS_WIN32 ws2_32
|
||||
)
|
||||
@@ -5,6 +5,15 @@
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
// MinGW's <signal.h> only defines the ANSI signals; the Windows process
|
||||
// backend interprets these values itself.
|
||||
#ifndef SIGTERM
|
||||
#define SIGTERM 15
|
||||
#endif
|
||||
#ifndef SIGKILL
|
||||
#define SIGKILL 9
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
|
||||
Reference in new issue
Block a user