diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2005-11-15 06:16:39 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2005-11-15 06:16:39 +0000 |
commit | c67b459cb3ed3ac21351cd611003be64c0d0f48e (patch) | |
tree | 4808ef4268da450b55d02fe7d353a7d29d66527a | |
parent | c1419b43ea354fa04360450ae4f64612df065099 (diff) |
minor compile fixes for Mac OS X and MinGW
svn path=/trunk/externals/ggee/; revision=3910
-rwxr-xr-x | signal/streamin~.c | 16 | ||||
-rwxr-xr-x | signal/streamout~.c | 11 |
2 files changed, 19 insertions, 8 deletions
diff --git a/signal/streamin~.c b/signal/streamin~.c index dd12f25..87c577c 100755 --- a/signal/streamin~.c +++ b/signal/streamin~.c @@ -21,8 +21,7 @@ #include <winsock.h>
#endif
-
-
+/* these pragmas are only used for MSVC, not MinGW or Cygwin <hans@at.or.at> */
#ifdef _MSC_VER
#pragma warning( disable : 4244 )
#pragma warning( disable : 4305 )
@@ -79,10 +78,15 @@ int setsocketoptions(int sockfd) {
#ifdef unix
int sockopt = 1;
- if (setsockopt(sockfd, SOL_TCP, TCP_NODELAY, (const char*) &sockopt, sizeof(int)) < 0)
- DEBUGMESS(post("setsockopt NODELAY failed\n"));
- else
- DEBUGMESS(post("TCP_NODELAY set"));
+ if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (const char*) &sockopt, sizeof(int)) < 0)
+ {
+ DEBUGMESS(post("setsockopt NODELAY failed\n"));
+ }
+ else
+ {
+ DEBUGMESS(post("TCP_NODELAY set"));
+ }
+
/* if we don`t use REUSEADDR we have to wait under unix until the
address gets freed after a close ... this can be very annoying
diff --git a/signal/streamout~.c b/signal/streamout~.c index e020419..a9c9d96 100755 --- a/signal/streamout~.c +++ b/signal/streamout~.c @@ -17,6 +17,9 @@ #include <winsock.h>
#endif
+#ifdef __APPLE__
+#include <unistd.h>
+#endif
/* Utility functions */
@@ -202,7 +205,9 @@ static t_int *streamout_perform(t_int *w) if (x->x_fd > 0) {
/* send the format tag */
-#ifdef unix
+#ifdef __APPLE__
+ if (send(x->x_fd,(char*)&x->x_tag,sizeof(t_tag),SO_NOSIGPIPE) < 0)
+#elif defined unix
if (send(x->x_fd,(char*)&x->x_tag,sizeof(t_tag),/*MSG_DONTWAIT|*/MSG_NOSIGNAL) < 0)
#else
if (send(x->x_fd,(char*)&x->x_tag,sizeof(t_tag),0) < 0)
@@ -217,7 +222,9 @@ static t_int *streamout_perform(t_int *w) for (sent = 0; sent < length;) {
int res = 0;
-#ifdef unix
+#ifdef __APPLE__
+ res = send(x->x_fd, bp, length-sent, SO_NOSIGPIPE);
+#elif defined unix
res = send(x->x_fd, bp, length-sent, /*MSG_DONTWAIT|*/MSG_NOSIGNAL);
#else
res = send(x->x_fd, bp, length-sent, 0);
|