From 127cc4a0235517838072ed6bcf7f26e476d58916 Mon Sep 17 00:00:00 2001 From: flagarde Date: Fri, 11 Feb 2022 12:49:33 +0800 Subject: [PATCH] Fix for MINGW32 and clang on windows (#352) (#357) * Update IXSocket.h Avoid "conflicting declaration 'typedef SSIZE_T ssize_t'" * Update IXUdpSocket.h * Update IXNetSystem.cpp ENOSPC and EAFNOSUPPORT are not defined for clang on windows --- ixwebsocket/IXNetSystem.cpp | 6 ++++++ ixwebsocket/IXSocket.h | 2 ++ ixwebsocket/IXUdpSocket.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/ixwebsocket/IXNetSystem.cpp b/ixwebsocket/IXNetSystem.cpp index 7b2a8541..c8bb7b17 100644 --- a/ixwebsocket/IXNetSystem.cpp +++ b/ixwebsocket/IXNetSystem.cpp @@ -8,6 +8,12 @@ #include #include #ifdef _WIN32 +#ifndef EAFNOSUPPORT + #define EAFNOSUPPORT 102 +#endif +#ifndef ENOSPC + #define ENOSPC 28 +#endif #include #endif diff --git a/ixwebsocket/IXSocket.h b/ixwebsocket/IXSocket.h index 1f4272d2..d1fa9691 100644 --- a/ixwebsocket/IXSocket.h +++ b/ixwebsocket/IXSocket.h @@ -14,8 +14,10 @@ #ifdef _WIN32 #include +#ifdef _MSC_VER typedef SSIZE_T ssize_t; #endif +#endif #include "IXCancellationRequest.h" #include "IXProgressCallback.h" diff --git a/ixwebsocket/IXUdpSocket.h b/ixwebsocket/IXUdpSocket.h index 35f8fec4..9f54daf9 100644 --- a/ixwebsocket/IXUdpSocket.h +++ b/ixwebsocket/IXUdpSocket.h @@ -12,8 +12,10 @@ #ifdef _WIN32 #include +#ifdef _MSC_VER typedef SSIZE_T ssize_t; #endif +#endif #include "IXNetSystem.h"