From 7022b337a9a682f1d974aed69f6065fa57b4164f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 28 Mar 2026 15:03:38 -0500 Subject: [PATCH] Refactor BSD socket errors for Win32 and add EMSGSIZE --- src/PlatformSockets.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/PlatformSockets.h b/src/PlatformSockets.h index 1ab0ee9..02a5445 100644 --- a/src/PlatformSockets.h +++ b/src/PlatformSockets.h @@ -42,18 +42,31 @@ extern in_port_t n3ds_udp_port; #endif #define EINTR WSAEINTR -#ifdef __MINGW32__ +#ifdef EWOULDBLOCK #undef EWOULDBLOCK +#endif +#define EWOULDBLOCK WSAEWOULDBLOCK + +#ifdef EINPROGRESS #undef EINPROGRESS +#endif +#define EINPROGRESS WSAEINPROGRESS + +#ifdef ETIMEDOUT #undef ETIMEDOUT +#endif +#define ETIMEDOUT WSAETIMEDOUT + +#ifdef ECONNREFUSED #undef ECONNREFUSED #endif - -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEINPROGRESS -#define ETIMEDOUT WSAETIMEDOUT #define ECONNREFUSED WSAECONNREFUSED +#ifdef EMSGSIZE +#undef EMSGSIZE +#endif +#define EMSGSIZE WSAEMSGSIZE + typedef int SOCK_RET; typedef int SOCKADDR_LEN;