aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compat/linux.h (renamed from src/linux_compatibility.h)0
-rw-r--r--src/compat/osx.h (renamed from src/osx_compatibility.h)0
-rw-r--r--src/compat/win32.cpp (renamed from src/win32_compatibility.cpp)2
-rw-r--r--src/compat/win32.h (renamed from src/win32_compatibility.h)2
-rw-r--r--src/config.h11
-rw-r--r--src/fifo.cpp2
-rw-r--r--src/file.cpp6
-rw-r--r--src/ito.cpp3
-rw-r--r--src/itoserver.cpp5
-rw-r--r--src/multiserver.cpp4
-rw-r--r--src/process.cpp5
-rw-r--r--src/server.cpp2
-rw-r--r--src/server.h3
-rw-r--r--src/serversocket.cpp5
-rw-r--r--src/socket.cpp5
15 files changed, 36 insertions, 19 deletions
diff --git a/src/linux_compatibility.h b/src/compat/linux.h
index ccc8536..ccc8536 100644
--- a/src/linux_compatibility.h
+++ b/src/compat/linux.h
diff --git a/src/osx_compatibility.h b/src/compat/osx.h
index 7169d7e..7169d7e 100644
--- a/src/osx_compatibility.h
+++ b/src/compat/osx.h
diff --git a/src/win32_compatibility.cpp b/src/compat/win32.cpp
index 98e63a7..6fcac15 100644
--- a/src/win32_compatibility.cpp
+++ b/src/compat/win32.cpp
@@ -5,7 +5,7 @@
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
6 */ 6 */
7 7
8#include "bu/win32_compatibility.h" 8#include "bu/compat/win32.h"
9 9
10#ifdef WIN32 10#ifdef WIN32
11 11
diff --git a/src/win32_compatibility.h b/src/compat/win32.h
index 220ed09..6304d4c 100644
--- a/src/win32_compatibility.h
+++ b/src/compat/win32.h
@@ -124,6 +124,8 @@ namespace Bu
124 124
125#undef decltype 125#undef decltype
126 126
127#undef USE_64BIT_IO
128
127#endif /* WIN32 */ 129#endif /* WIN32 */
128#endif 130#endif
129 131
diff --git a/src/config.h b/src/config.h
new file mode 100644
index 0000000..05ef99a
--- /dev/null
+++ b/src/config.h
@@ -0,0 +1,11 @@
1#ifndef BU_CONFIG_H
2#define BU_CONFIG_H
3
4// Use 64 bit IO functions where applicable (i.e. large file support)
5#define USE_64BIT_IO
6
7#include "bu/compat/win32.h"
8#include "bu/compat/osx.h"
9#include "bu/compat/linux.h"
10
11#endif
diff --git a/src/fifo.cpp b/src/fifo.cpp
index ebea927..d1fa960 100644
--- a/src/fifo.cpp
+++ b/src/fifo.cpp
@@ -12,7 +12,7 @@
12#include <fcntl.h> 12#include <fcntl.h>
13#include <unistd.h> 13#include <unistd.h>
14 14
15#include "win32_compatibility.h" 15#include "bu/config.h"
16 16
17namespace Bu { subExceptionDef( FifoException ) } 17namespace Bu { subExceptionDef( FifoException ) }
18 18
diff --git a/src/file.cpp b/src/file.cpp
index 4d79f1e..f1f63e4 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -13,13 +13,19 @@
13#include <unistd.h> 13#include <unistd.h>
14#include <stdlib.h> // for mkstemp 14#include <stdlib.h> // for mkstemp
15 15
16#include "bu/config.h"
17
16namespace Bu { subExceptionDef( FileException ) } 18namespace Bu { subExceptionDef( FileException ) }
17 19
18Bu::File::File( const Bu::FString &sName, int iFlags ) : 20Bu::File::File( const Bu::FString &sName, int iFlags ) :
19 fd( -1 ), 21 fd( -1 ),
20 bEos( true ) 22 bEos( true )
21{ 23{
24#ifdef USE_64BIT_IO
25 fd = ::open64( sName.getStr(), getPosixFlags( iFlags ), 0666 );
26#else
22 fd = ::open( sName.getStr(), getPosixFlags( iFlags ), 0666 ); 27 fd = ::open( sName.getStr(), getPosixFlags( iFlags ), 0666 );
28#endif
23 if( fd < 0 ) 29 if( fd < 0 )
24 { 30 {
25 throw Bu::FileException( errno, "%s: %s", 31 throw Bu::FileException( errno, "%s: %s",
diff --git a/src/ito.cpp b/src/ito.cpp
index 0218ecc..12aee6f 100644
--- a/src/ito.cpp
+++ b/src/ito.cpp
@@ -6,7 +6,8 @@
6 */ 6 */
7 7
8#include "bu/ito.h" 8#include "bu/ito.h"
9#include "bu/osx_compatibility.h" 9
10#include "bu/config.h"
10 11
11Bu::Ito::Ito() 12Bu::Ito::Ito()
12{ 13{
diff --git a/src/itoserver.cpp b/src/itoserver.cpp
index 279310d..a1d804a 100644
--- a/src/itoserver.cpp
+++ b/src/itoserver.cpp
@@ -5,14 +5,13 @@
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
6 */ 6 */
7 7
8#include "win32_compatibility.h"
9
10#include "bu/itoserver.h" 8#include "bu/itoserver.h"
11#include <errno.h> 9#include <errno.h>
12#include "bu/serversocket.h" 10#include "bu/serversocket.h"
13#include "bu/client.h" 11#include "bu/client.h"
14#include "bu/socket.h" 12#include "bu/socket.h"
15#include "bu/osx_compatibility.h" 13
14#include "bu/config.h"
16 15
17Bu::ItoServer::ItoServer() : 16Bu::ItoServer::ItoServer() :
18 nTimeoutSec( 1 ), 17 nTimeoutSec( 1 ),
diff --git a/src/multiserver.cpp b/src/multiserver.cpp
index 4eccde8..a6cee36 100644
--- a/src/multiserver.cpp
+++ b/src/multiserver.cpp
@@ -5,12 +5,12 @@
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
6 */ 6 */
7 7
8#include "win32_compatibility.h"
9
10#include "bu/multiserver.h" 8#include "bu/multiserver.h"
11#include "bu/protocol.h" 9#include "bu/protocol.h"
12#include "bu/client.h" 10#include "bu/client.h"
13 11
12#include "bu/config.h"
13
14Bu::MultiServer::MultiServer() 14Bu::MultiServer::MultiServer()
15{ 15{
16} 16}
diff --git a/src/process.cpp b/src/process.cpp
index c6c86f2..da38e64 100644
--- a/src/process.cpp
+++ b/src/process.cpp
@@ -15,9 +15,8 @@
15#include <errno.h> 15#include <errno.h>
16 16
17#include <sys/select.h> 17#include <sys/select.h>
18#include "bu/osx_compatibility.h" 18
19#include "bu/win32_compatibility.h" 19#include "bu/config.h"
20#include "bu/linux_compatibility.h"
21 20
22Bu::Process::Process( Flags eFlags, const char *sName, char *const argv[] ) : 21Bu::Process::Process( Flags eFlags, const char *sName, char *const argv[] ) :
23 iStdIn( -1 ), 22 iStdIn( -1 ),
diff --git a/src/server.cpp b/src/server.cpp
index e55713d..64ddf9f 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -11,7 +11,7 @@
11#include "bu/serversocket.h" 11#include "bu/serversocket.h"
12#include "bu/client.h" 12#include "bu/client.h"
13#include "bu/socket.h" 13#include "bu/socket.h"
14#include "bu/osx_compatibility.h" 14#include "bu/config.h"
15 15
16Bu::Server::Server() : 16Bu::Server::Server() :
17 nTimeoutSec( 0 ), 17 nTimeoutSec( 0 ),
diff --git a/src/server.h b/src/server.h
index d83c346..e09246f 100644
--- a/src/server.h
+++ b/src/server.h
@@ -20,7 +20,8 @@
20#include "bu/clientlink.h" 20#include "bu/clientlink.h"
21#include "bu/clientlinkfactory.h" 21#include "bu/clientlinkfactory.h"
22#include "bu/hash.h" 22#include "bu/hash.h"
23#include "bu/win32_compatibility.h" 23
24#include "bu/config.h"
24 25
25namespace Bu 26namespace Bu
26{ 27{
diff --git a/src/serversocket.cpp b/src/serversocket.cpp
index 37eb3d4..87d0035 100644
--- a/src/serversocket.cpp
+++ b/src/serversocket.cpp
@@ -22,9 +22,8 @@
22//#include <termios.h> 22//#include <termios.h>
23#include <fcntl.h> 23#include <fcntl.h>
24#include "bu/serversocket.h" 24#include "bu/serversocket.h"
25#include "bu/osx_compatibility.h" 25
26#include "bu/win32_compatibility.h" 26#include "bu/config.h"
27#include "bu/linux_compatibility.h"
28 27
29namespace Bu { subExceptionDef( ServerSocketException ) } 28namespace Bu { subExceptionDef( ServerSocketException ) }
30 29
diff --git a/src/socket.cpp b/src/socket.cpp
index a175ee9..6a30f44 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -15,9 +15,8 @@
15#include <errno.h> 15#include <errno.h>
16#include <fcntl.h> 16#include <fcntl.h>
17#include "bu/socket.h" 17#include "bu/socket.h"
18#include "bu/osx_compatibility.h" 18
19#include "bu/win32_compatibility.h" 19#include "bu/config.h"
20#include "bu/linux_compatibility.h"
21 20
22#ifndef WIN32 21#ifndef WIN32
23 #include <sys/socket.h> 22 #include <sys/socket.h>