From bfd32981f084b9f637b176bd086bc1debade56fd Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sun, 27 Dec 2009 18:34:56 +0000 Subject: the included sys_* functions are different than the ones in s_stuff.h, so use them instead of the standard Pd ones svn path=/trunk/externals/ggee/; revision=12847 --- signal/streamin~.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/signal/streamin~.c b/signal/streamin~.c index fcb8084..c2a4f7d 100644 --- a/signal/streamin~.c +++ b/signal/streamin~.c @@ -3,7 +3,6 @@ /* Thanks to Anthony Lee for Windows bug fixes */ #include -#include #include "stream.h" #include @@ -48,17 +47,17 @@ #ifdef _WIN32 extern int close(int); +#endif extern void sys_rmpollfn(int fd); extern sys_addpollfn(int fd, void* fn, void *ptr); -#endif static void sys_sockerror(char *s) { -#ifdef unix - int err = errno; -#else +#ifdef _WIN32 int err = WSAGetLastError(); if (err == 10054) return; +#else + int err = errno; #endif post("%s: %s (%d)\n", s, strerror(err), err); } @@ -66,18 +65,17 @@ static void sys_sockerror(char *s) static void sys_closesocket(int fd) { -#ifdef UNIX - close(fd); -#endif #ifdef _WIN32 closesocket(fd); +#else + close(fd); #endif } int setsocketoptions(int sockfd) { -#ifdef unix +#ifndef _WIN32 int sockopt = 1; if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (const char*) &sockopt, sizeof(int)) < 0) { -- cgit v1.2.1