TPIE

v1.1rc1-6-g0c97303
types.h
Go to the documentation of this file.
1 // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup"; -*-
2 // vi:set ts=4 sts=4 sw=4 noet :
3 // Copyright 2009, 2010, 2012, The TPIE development team
4 //
5 // This file is part of TPIE.
6 //
7 // TPIE is free software: you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the
9 // Free Software Foundation, either version 3 of the License, or (at your
10 // option) any later version.
11 //
12 // TPIE is distributed in the hope that it will be useful, but WITHOUT ANY
13 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with TPIE. If not, see <http://www.gnu.org/licenses/>
19 
23 
24 #ifndef _TPIE_TYPES_H
25 #define _TPIE_TYPES_H
26 
27 #include <boost/cstdint.hpp>
28 #ifdef _WIN32
29 #include <basetsd.h>
30 #endif
31 
32 namespace tpie {
33 
34 using boost::uint8_t;
35 using boost::int8_t;
36 using boost::uint16_t;
37 using boost::int16_t;
38 using boost::uint32_t;
39 using boost::int32_t;
40 using boost::uint64_t;
41 using boost::int64_t;
42 
43 typedef boost::uint64_t stream_size_type;
44 typedef boost::int64_t stream_offset_type;
45 typedef ::size_t memory_size_type;
46 #ifdef _WIN32
47 typedef SSIZE_T memory_offset_type;
48 #else
49 typedef ::ssize_t memory_offset_type;
50 #endif
51 
52 typedef stream_offset_type offset_type;
53 
54 #ifdef _WIN32
55 typedef __int64 offset_type;
56 #else
57 typedef off_t offset_type;
58 #endif
59 
60 #if defined (_WIN32) && !defined(__MINGW32__)
61 typedef SSIZE_T ssize_type;
62 #ifdef _TPIE_SMALL_MAIN_MEMORY
63 #if (_MSC_VER < 1400)
64 typedef unsigned __int32 size_type;
65 #else
66 typedef size_t size_type;
67 #endif
68 #else
69 typedef size_t size_type;
70 #endif
71 #else
72 typedef ssize_t ssize_type;
73 typedef size_t size_type;
74 #endif
75 }
76 
77 #endif //_TPIE_TYPES_H