From 2a2f2cfc63df6d90a7731ceba113edf9be53bab6 Mon Sep 17 00:00:00 2001 From: everHannes Date: Wed, 16 Sep 2015 15:30:18 +0200 Subject: [PATCH] fix msvc _WIN64 ssize_t definition --- src/compat/windows/wincompat.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/compat/windows/wincompat.h b/src/compat/windows/wincompat.h index 6d6f414..69de64d 100644 --- a/src/compat/windows/wincompat.h +++ b/src/compat/windows/wincompat.h @@ -105,10 +105,15 @@ static inline struct cmsghdr *CMSG_NXTHDR(struct msghdr *m, struct cmsghdr *c) { #ifdef _MSC_VER // VS2012 and up has no ssize_t defined, before it was defined as unsigned int - #ifndef _SSIZE_T - #define _SSIZE_T - typedef signed int ssize_t; - #endif + #ifndef _SSIZE_T_DEFINED + #define _SSIZE_T_DEFINED + #undef ssize_t + #ifdef _WIN64 + typedef signed __int64 ssize_t; + #else + typedef signed int ssize_t; + #endif + #endif #endif ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags); -- 2.39.2