int pipe(int pipefd[2])
{
- int lsock = INVALID_SOCKET;
+ int lsock = (int)INVALID_SOCKET;
struct sockaddr_in laddr;
socklen_t laddrlen = sizeof(laddr);
- pipefd[0] = pipefd[1] = INVALID_SOCKET;
+ pipefd[0] = pipefd[1] = (int)INVALID_SOCKET;
// bind a listening socket to a TCP port on localhost
laddr.sin_family = AF_INET;
strncpy(buf->version, "unknown", sizeof(buf->sysname)-1); // we don't need it
// computer (node) name
- if(GetComputerName(buf->nodename, sizeof(buf->nodename)-1) == 0) {
+ DWORD nodename_size = sizeof(buf->nodename)-1;
+ if(GetComputerName(buf->nodename, &nodename_size) == 0) {
errno = EFAULT;
return -1;
}
#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
+ #define _SSIZE_T
+ typedef signed int ssize_t;
+ #endif
#endif
ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);