TPIE

2362a60
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 <cstdint>
28 #include <cstddef>
29 #ifdef _WIN32
30 #include <basetsd.h>
31 #else
32 #include <sys/types.h>
33 #endif
34 
35 namespace tpie {
36 
37 using std::uint8_t;
38 using std::int8_t;
39 using std::uint16_t;
40 using std::int16_t;
41 using std::uint32_t;
42 using std::int32_t;
43 using std::uint64_t;
44 using std::int64_t;
45 
46 typedef uint64_t stream_size_type;
47 typedef int64_t stream_offset_type;
48 typedef std::size_t memory_size_type;
49 #ifdef _WIN32
50 typedef SSIZE_T memory_offset_type;
51 #else
52 typedef ssize_t memory_offset_type;
53 #endif
54 
55 typedef stream_offset_type offset_type;
56 
57 #ifdef _WIN32
58 typedef __int64 offset_type;
59 #else
60 typedef off_t offset_type;
61 #endif
62 
63 #if defined (_WIN32) && !defined(__MINGW32__)
64 typedef SSIZE_T ssize_type;
65 #ifdef _TPIE_SMALL_MAIN_MEMORY
66 #if (_MSC_VER < 1400)
67 typedef unsigned __int32 size_type;
68 #else
69 typedef size_t size_type;
70 #endif
71 #else
72 typedef size_t size_type;
73 #endif
74 #else
75 typedef ssize_t ssize_type;
76 typedef size_t size_type;
77 #endif
78 }
79 
80 #endif //_TPIE_TYPES_H