diff options
Diffstat (limited to 'patches/libbu++-osx-compatability.patch')
-rw-r--r-- | patches/libbu++-osx-compatability.patch | 85 |
1 files changed, 85 insertions, 0 deletions
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 @@ | |||
1 | Index: src/server.cpp | ||
2 | =================================================================== | ||
3 | --- src/server.cpp (revision 345) | ||
4 | +++ src/server.cpp (working copy) | ||
5 | @@ -3,6 +3,7 @@ | ||
6 | #include "bu/serversocket.h" | ||
7 | #include "bu/client.h" | ||
8 | #include "bu/socket.h" | ||
9 | +#include "osx_compatibility.h" | ||
10 | |||
11 | Bu::Server::Server() : | ||
12 | nTimeoutSec( 0 ), | ||
13 | Index: src/socket.cpp | ||
14 | =================================================================== | ||
15 | --- src/socket.cpp (revision 345) | ||
16 | +++ src/socket.cpp (working copy) | ||
17 | @@ -13,6 +13,7 @@ | ||
18 | #include <fcntl.h> | ||
19 | #include "socket.h" | ||
20 | #include "exceptions.h" | ||
21 | +#include "osx_compatibility.h" | ||
22 | |||
23 | #define RBS (1024*2) | ||
24 | |||
25 | Index: src/osx_compatibility.h | ||
26 | =================================================================== | ||
27 | --- src/osx_compatibility.h (revision 0) | ||
28 | +++ src/osx_compatibility.h (revision 0) | ||
29 | @@ -0,0 +1,19 @@ | ||
30 | +#ifndef OSX_COMPATIBILITY__H | ||
31 | +#define OSX_COMPATIBILITY__H | ||
32 | + | ||
33 | +#ifdef __APPLE__ | ||
34 | + | ||
35 | +#ifndef TEMP_FAILURE_RETRY | ||
36 | +#define TEMP_FAILURE_RETRY(expression) \ | ||
37 | + (__extension__ \ | ||
38 | + ({ long int __result; \ | ||
39 | + do __result = (long int) (expression); \ | ||
40 | + while (__result == -1L && errno == EINTR); \ | ||
41 | + __result; })) | ||
42 | +#endif | ||
43 | + | ||
44 | +#include <sched.h> | ||
45 | + | ||
46 | +#define pthread_yield() sched_yield() | ||
47 | +#endif /* __APPLE__ */ | ||
48 | +#endif | ||
49 | \ No newline at end of file | ||
50 | Index: src/serversocket.cpp | ||
51 | =================================================================== | ||
52 | --- src/serversocket.cpp (revision 345) | ||
53 | +++ src/serversocket.cpp (working copy) | ||
54 | @@ -13,6 +13,7 @@ | ||
55 | #include <fcntl.h> | ||
56 | #include "serversocket.h" | ||
57 | #include "exceptions.h" | ||
58 | +#include "osx_compatibility.h" | ||
59 | |||
60 | Bu::ServerSocket::ServerSocket( int nPort, int nPoolSize ) : | ||
61 | nPort( nPort ) | ||
62 | @@ -118,8 +119,12 @@ | ||
63 | (int *)&size | ||
64 | ); | ||
65 | #else | ||
66 | - nClient = ::accept( nServer, (struct sockaddr *)&clientname, &size ); | ||
67 | +#ifdef __APPLE__ | ||
68 | + nClient = ::accept( nServer, (struct sockaddr *)&clientname, (socklen_t*)&size ); | ||
69 | +#else | ||
70 | + nClient = ::accept( nServer, (struct sockaddr *)&clientname, &size ); | ||
71 | #endif | ||
72 | +#endif | ||
73 | if( nClient < 0 ) | ||
74 | { | ||
75 | throw SocketException( | ||
76 | Index: src/ito.cpp | ||
77 | =================================================================== | ||
78 | --- src/ito.cpp (revision 345) | ||
79 | +++ src/ito.cpp (working copy) | ||
80 | @@ -1,4 +1,5 @@ | ||
81 | #include "ito.h" | ||
82 | +#include "osx_compatibility.h" | ||
83 | |||
84 | Bu::Ito::Ito() | ||
85 | { | ||