Chris@16
|
1 /*
|
Chris@16
|
2 * Distributed under the Boost Software License, Version 1.0.(See accompanying
|
Chris@16
|
3 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
|
Chris@16
|
4 *
|
Chris@16
|
5 * See http://www.boost.org/libs/iostreams for documentation.
|
Chris@16
|
6 *
|
Chris@16
|
7 * Defines preprocessor symbols expanding to the names of functions in the
|
Chris@16
|
8 * C runtime library used to access file descriptors and to the type used
|
Chris@16
|
9 * to store file offsets for seeking.
|
Chris@16
|
10 *
|
Chris@16
|
11 * File: boost/iostreams/detail/config/rtl.hpp
|
Chris@16
|
12 * Date: Wed Dec 26 11:58:11 MST 2007
|
Chris@16
|
13 *
|
Chris@16
|
14 * Copyright: 2007-2008 CodeRage, LLC
|
Chris@16
|
15 * Author: Jonathan Turkanis
|
Chris@16
|
16 * Contact: turkanis at coderage dot com
|
Chris@16
|
17 */
|
Chris@16
|
18
|
Chris@16
|
19 #ifndef BOOST_IOSTREAMS_DETAIL_CONFIG_RTL_HPP_INCLUDED
|
Chris@16
|
20 #define BOOST_IOSTREAMS_DETAIL_CONFIG_RTL_HPP_INCLUDED
|
Chris@16
|
21
|
Chris@16
|
22 #include <boost/config.hpp>
|
Chris@16
|
23 #include <boost/iostreams/detail/config/windows_posix.hpp>
|
Chris@16
|
24
|
Chris@16
|
25 // Handle open, close, read, and write
|
Chris@16
|
26 #ifdef __BORLANDC__
|
Chris@16
|
27 # define BOOST_IOSTREAMS_RTL(x) BOOST_JOIN(_rtl_, x)
|
Chris@16
|
28 #elif defined BOOST_IOSTREAMS_WINDOWS
|
Chris@16
|
29 # define BOOST_IOSTREAMS_RTL(x) BOOST_JOIN(_, x)
|
Chris@16
|
30 #else
|
Chris@16
|
31 # define BOOST_IOSTREAMS_RTL(x) ::x // Distinguish from member function named x
|
Chris@16
|
32 #endif
|
Chris@16
|
33 #define BOOST_IOSTREAMS_FD_OPEN BOOST_IOSTREAMS_RTL(open)
|
Chris@16
|
34 #define BOOST_IOSTREAMS_FD_CLOSE BOOST_IOSTREAMS_RTL(close)
|
Chris@16
|
35 #define BOOST_IOSTREAMS_FD_READ BOOST_IOSTREAMS_RTL(read)
|
Chris@16
|
36 #define BOOST_IOSTREAMS_FD_WRITE BOOST_IOSTREAMS_RTL(write)
|
Chris@16
|
37
|
Chris@16
|
38 // Handle lseek, off_t, ftruncate, and stat
|
Chris@16
|
39 #ifdef BOOST_IOSTREAMS_WINDOWS
|
Chris@16
|
40 # if defined(BOOST_MSVC) || defined(__MSVCRT__) // MSVC, MinGW
|
Chris@16
|
41 # define BOOST_IOSTREAMS_FD_SEEK _lseeki64
|
Chris@16
|
42 # define BOOST_IOSTREAMS_FD_OFFSET __int64
|
Chris@16
|
43 # else // Borland, Metrowerks, ...
|
Chris@16
|
44 # define BOOST_IOSTREAMS_FD_SEEK lseek
|
Chris@16
|
45 # define BOOST_IOSTREAMS_FD_OFFSET long
|
Chris@16
|
46 # endif
|
Chris@16
|
47 #else // Non-windows
|
Chris@16
|
48 # if defined(_LARGEFILE64_SOURCE) && !defined(__APPLE__) && \
|
Chris@16
|
49 (!defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64) || \
|
Chris@16
|
50 defined(_AIX) && !defined(_LARGE_FILES) || \
|
Chris@16
|
51 defined(BOOST_IOSTREAMS_HAS_LARGE_FILE_EXTENSIONS)
|
Chris@16
|
52 /**/
|
Chris@16
|
53
|
Chris@16
|
54 /* Systems with transitional extensions for large file support */
|
Chris@16
|
55
|
Chris@16
|
56 # define BOOST_IOSTREAMS_FD_SEEK lseek64
|
Chris@16
|
57 # define BOOST_IOSTREAMS_FD_TRUNCATE ftruncate64
|
Chris@16
|
58 # define BOOST_IOSTREAMS_FD_MMAP mmap64
|
Chris@16
|
59 # define BOOST_IOSTREAMS_FD_STAT stat64
|
Chris@16
|
60 # define BOOST_IOSTREAMS_FD_FSTAT fstat64
|
Chris@16
|
61 # define BOOST_IOSTREAMS_FD_OFFSET off64_t
|
Chris@16
|
62 # else
|
Chris@16
|
63 # define BOOST_IOSTREAMS_FD_SEEK lseek
|
Chris@16
|
64 # define BOOST_IOSTREAMS_FD_TRUNCATE ftruncate
|
Chris@16
|
65 # define BOOST_IOSTREAMS_FD_MMAP mmap
|
Chris@16
|
66 # define BOOST_IOSTREAMS_FD_STAT stat
|
Chris@16
|
67 # define BOOST_IOSTREAMS_FD_FSTAT fstat
|
Chris@16
|
68 # define BOOST_IOSTREAMS_FD_OFFSET off_t
|
Chris@16
|
69 # endif
|
Chris@16
|
70 #endif
|
Chris@16
|
71
|
Chris@16
|
72 #endif // #ifndef BOOST_IOSTREAMS_DETAIL_CONFIG_RTL_HPP_INCLUDED
|