From 162525457320b5dba9a4e736759f840757635231 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 18 Jul 2007 07:17:10 +0000 Subject: Incorporated a patch contributed by Brandon CS Sanders that allows libbu++ to compile under OSX. So far, no problems with anything else, it looks like build and nango both build without problems, libbu++ is truly becoming a full cross- platform toolkit. --- patches/libbu++-osx-compatability.patch | 85 +++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 patches/libbu++-osx-compatability.patch (limited to 'patches') diff --git a/patches/libbu++-osx-compatability.patch b/patches/libbu++-osx-compatability.patch new file mode 100644 index 0000000..73f4d7a --- /dev/null +++ b/patches/libbu++-osx-compatability.patch @@ -0,0 +1,85 @@ +Index: src/server.cpp +=================================================================== +--- src/server.cpp (revision 345) ++++ src/server.cpp (working copy) +@@ -3,6 +3,7 @@ + #include "bu/serversocket.h" + #include "bu/client.h" + #include "bu/socket.h" ++#include "osx_compatibility.h" + + Bu::Server::Server() : + nTimeoutSec( 0 ), +Index: src/socket.cpp +=================================================================== +--- src/socket.cpp (revision 345) ++++ src/socket.cpp (working copy) +@@ -13,6 +13,7 @@ + #include + #include "socket.h" + #include "exceptions.h" ++#include "osx_compatibility.h" + + #define RBS (1024*2) + +Index: src/osx_compatibility.h +=================================================================== +--- src/osx_compatibility.h (revision 0) ++++ src/osx_compatibility.h (revision 0) +@@ -0,0 +1,19 @@ ++#ifndef OSX_COMPATIBILITY__H ++#define OSX_COMPATIBILITY__H ++ ++#ifdef __APPLE__ ++ ++#ifndef TEMP_FAILURE_RETRY ++#define TEMP_FAILURE_RETRY(expression) \ ++ (__extension__ \ ++ ({ long int __result; \ ++ do __result = (long int) (expression); \ ++ while (__result == -1L && errno == EINTR); \ ++ __result; })) ++#endif ++ ++#include ++ ++#define pthread_yield() sched_yield() ++#endif /* __APPLE__ */ ++#endif +\ No newline at end of file +Index: src/serversocket.cpp +=================================================================== +--- src/serversocket.cpp (revision 345) ++++ src/serversocket.cpp (working copy) +@@ -13,6 +13,7 @@ + #include + #include "serversocket.h" + #include "exceptions.h" ++#include "osx_compatibility.h" + + Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : + nPort( nPort ) +@@ -118,8 +119,12 @@ + (int *)&size + ); + #else +- nClient = ::accept( nServer, (struct sockaddr *)&clientname, &size ); ++#ifdef __APPLE__ ++ nClient = ::accept( nServer, (struct sockaddr *)&clientname, (socklen_t*)&size ); ++#else ++ nClient = ::accept( nServer, (struct sockaddr *)&clientname, &size ); + #endif ++#endif + if( nClient < 0 ) + { + throw SocketException( +Index: src/ito.cpp +=================================================================== +--- src/ito.cpp (revision 345) ++++ src/ito.cpp (working copy) +@@ -1,4 +1,5 @@ + #include "ito.h" ++#include "osx_compatibility.h" + + Bu::Ito::Ito() + { -- cgit v1.2.3