X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fcompat%2Fwindows%2Fwincompat.h;h=69de64d06e7f13ce733ad554d91a79b367543be4;hb=2a2f2cfc63df6d90a7731ceba113edf9be53bab6;hp=ac151c9ecf7bca078e185e41793db801234bd48f;hpb=5f77c7c2c4e2013e75cc39de4de32eddd3227d33;p=catta diff --git a/src/compat/windows/wincompat.h b/src/compat/windows/wincompat.h index ac151c9..69de64d 100644 --- a/src/compat/windows/wincompat.h +++ b/src/compat/windows/wincompat.h @@ -103,10 +103,17 @@ static inline struct cmsghdr *CMSG_NXTHDR(struct msghdr *m, struct cmsghdr *c) { #undef CMSG_DATA #define CMSG_DATA(c) WSA_CMSG_DATA(c) -// 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; +#ifdef _MSC_VER + // VS2012 and up has no ssize_t defined, before it was defined as unsigned int + #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);