From: everHannes Date: Wed, 16 Sep 2015 13:30:18 +0000 (+0200) Subject: fix msvc _WIN64 ssize_t definition X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=2a2f2cfc63df6d90a7731ceba113edf9be53bab6;p=catta fix msvc _WIN64 ssize_t definition --- 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);