aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/udpreceive~.c9
-rw-r--r--net/udpsend~.c11
2 files changed, 11 insertions, 9 deletions
diff --git a/net/udpreceive~.c b/net/udpreceive~.c
index cbf8040..3e8a419 100644
--- a/net/udpreceive~.c
+++ b/net/udpreceive~.c
@@ -36,7 +36,7 @@
#include <sys/types.h>
#include <string.h>
-#ifdef UNIX
+#if defined(UNIX) || defined(unix)
#include <sys/socket.h>
#include <errno.h>
#include <netinet/in.h>
@@ -48,7 +48,8 @@
#include <fcntl.h>
#include <stdio.h>
#define SOCKET_ERROR -1
-#else
+#endif
+#ifdef _WIN32
#include <winsock.h>
#endif
@@ -61,7 +62,7 @@
#define DEFAULT_NETWORK_POLLTIME 1 /* interval in ms for polling for input data (Max/MSP only) */
#define DEFAULT_QUEUE_LENGTH 3 /* min. number of buffers that can be used reliably on your hardware */
-#ifdef UNIX
+#if defined(UNIX) || defined(unix)
#define CLOSESOCKET(fd) close(fd)
#endif
#ifdef _WIN32
@@ -725,7 +726,7 @@ static int udpreceive_tilde_sockerror(char *s)
#ifdef _WIN32
if (err == WSAEWOULDBLOCK)
#endif
-#ifdef UNIX
+#if defined(UNIX) || defined(unix)
if (err == EAGAIN)
#endif
{
diff --git a/net/udpsend~.c b/net/udpsend~.c
index ce9bcad..70a3a7b 100644
--- a/net/udpsend~.c
+++ b/net/udpsend~.c
@@ -39,7 +39,7 @@
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
-#ifdef UNIX
+#if defined(UNIX) || defined(unix)
#include <sys/socket.h>
#include <errno.h>
#include <netinet/in.h>
@@ -51,7 +51,8 @@
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
-#include <pthread.h>
+#include <pthread.h>
+#include <math.h>
#define SOCKET_ERROR -1
#endif
#ifdef _WIN32
@@ -556,7 +557,7 @@ static void *udpsend_tilde_new(t_floatarg inlets, t_floatarg prot)
x->x_cbufsize = x->x_blocksize * sizeof(t_float) * x->x_ninlets;
x->x_cbuf = (char *)t_getbytes(x->x_cbufsize);
-#ifdef UNIX
+#if defined(UNIX) || defined(unix)
/* we don't want to get signaled in case send() fails */
signal(SIGPIPE, SIG_IGN);
#endif
@@ -626,7 +627,7 @@ static int udpsend_tilde_sockerror(char *s)
#ifdef _WIN32
if (err == WSAEWOULDBLOCK)
#endif
-#ifdef UNIX
+#if defined(UNIX) || defined(unix)
if (err == EAGAIN)
#endif
{
@@ -637,7 +638,7 @@ static int udpsend_tilde_sockerror(char *s)
static void udpsend_tilde_closesocket(int fd)
{
-#ifdef UNIX
+#if defined(UNIX) || defined(unix)
close(fd);
#endif
#ifdef _WIN32