From: vollkorn1982 Date: Wed, 16 Sep 2015 14:11:12 +0000 (+0200) Subject: Merge pull request #4 from catta-x/feature/wincompat X-Git-Url: http://git.meshlink.io/?p=catta;a=commitdiff_plain;h=cab98272649ebd0c6b6760a1f267ca113abec02d;hp=62e72dc30b5527372d1d73ef4ce4bc8ffb782451 Merge pull request #4 from catta-x/feature/wincompat 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);