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