aboutsummaryrefslogtreecommitdiff
path: root/streamout13~.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-09-24 23:05:22 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-09-24 23:05:22 +0000
commit3a7e12ea0f7a96e74d4b9b4431314e0f5720590d (patch)
tree213438334abfed7bb9c4137780f4ab2b51d90562 /streamout13~.c
parent090323d7f7012084632c13b9ffdd88ce8817618a (diff)
MinGW cleanups
svn path=/trunk/externals/ext13/; revision=6013
Diffstat (limited to 'streamout13~.c')
-rw-r--r--streamout13~.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/streamout13~.c b/streamout13~.c
index b7324da..2dc5725 100644
--- a/streamout13~.c
+++ b/streamout13~.c
@@ -3,14 +3,14 @@
#include <sys/types.h>
#include <string.h>
-#if defined(UNIX) || defined(unix)
+#ifdef _WIN32
+#include <winsock.h>
+#else
#include <sys/errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define SOCKET_ERROR -1
-#else
-#include <winsock.h>
#endif
#ifdef __APPLE__
@@ -28,11 +28,11 @@
static void sys_sockerror(char *s)
{
-#if defined(UNIX) || defined(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);
}
@@ -41,11 +41,10 @@ static void sys_sockerror(char *s)
static void sys_closesocket(int fd)
{
-#if defined(UNIX) || defined(unix)
- close(fd);
-#endif
-#ifdef NT
+#ifdef _WIN32
closesocket(fd);
+#else
+ close(fd);
#endif
}
@@ -162,7 +161,7 @@ static t_int *streamout13_perform(t_int *w)
char* buf = (char *)(w[2]);
short* cibuf;
char* bp;
-#ifndef NT
+#ifndef _WIN32
t_float *in[x->x_n];
#else
t_float** in = (t_float**) malloc(x->x_n * sizeof(t_float*));
@@ -269,7 +268,7 @@ static t_int *streamout13_perform(t_int *w)
}
}
// post ("b-s-s:%d, length:%d, last:%d, prev:%d",x->blockssincesend,length,*cibuf,prev);
-#ifdef NT
+#ifdef _WIN32
free(in);
#endif
return (w + 2 + i * 2);