From 774dfec29eef3cb17309ef878f96559876eb2b7f Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Mon, 11 May 2026 15:24:26 +0200 Subject: [PATCH] Fix mingw32 build: cast setsockopt optval to const char * On Windows, the Winsock setsockopt prototype takes `const char *optval`, not `const void *` like POSIX. Passing `&one` (int *) breaks the mingw32 build with -Wincompatible-pointer-types. Cast to (const char *) so it compiles on both POSIX and Winsock. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/ps2link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ps2link.c b/src/ps2link.c index 4199ad6..2e96a31 100644 --- a/src/ps2link.c +++ b/src/ps2link.c @@ -58,7 +58,7 @@ // ~200 ms stall per read() syscall, making fread() ~400x slower than read(). if (request_socket > 0) { int one = 1; - setsockopt(request_socket, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); + setsockopt(request_socket, IPPROTO_TCP, TCP_NODELAY, (const char *)&one, sizeof(one)); } // Create the request thread.