STXXL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
types.h
Go to the documentation of this file.
1 /***************************************************************************
2  * include/stxxl/bits/common/types.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2007 Roman Dementiev <[email protected]>
7  * Copyright (C) 2010 Andreas Beckmann <[email protected]>
8  *
9  * Distributed under the Boost Software License, Version 1.0.
10  * (See accompanying file LICENSE_1_0.txt or copy at
11  * http://www.boost.org/LICENSE_1_0.txt)
12  **************************************************************************/
13 
14 #ifndef STXXL_COMMON_TYPES_HEADER
15 #define STXXL_COMMON_TYPES_HEADER
16 
17 #include <stxxl/bits/config.h>
18 #include <stxxl/bits/namespace.h>
19 
21 
22 #if STXXL_MSVC
23 typedef __int8 int8;
24 typedef unsigned __int8 uint8;
25 typedef __int16 int16;
26 typedef unsigned __int16 uint16;
27 typedef __int32 int32;
28 typedef unsigned __int32 uint32;
29 typedef __int64 int64;
30 typedef unsigned __int64 uint64;
31 #else
32 typedef char int8;
33 typedef unsigned char uint8;
34 typedef short int16;
35 typedef unsigned short uint16;
36 typedef int int32;
37 typedef unsigned int uint32;
38 typedef long long int int64;
39 typedef unsigned long long int uint64;
40 #endif
41 
42 // integer types declarations
43 enum { my_pointer_size = sizeof(void*) };
44 
45 template <int PtrSize>
47 { };
48 
49 template <>
50 struct choose_int_types<4> // for 32-bit processors/compilers
51 {
52  typedef int32 int_type;
54 };
55 
56 template <>
57 struct choose_int_types<8> // for 64-bit processors/compilers
58 {
59  typedef int64 int_type;
61 };
62 
65 
66 typedef unsigned_type internal_size_type; // fits in internal memory
67 typedef uint64 external_size_type; // may require external memory
68 
70 
71 #endif // !STXXL_COMMON_TYPES_HEADER
short int16
Definition: types.h:34
long long int int64
Definition: types.h:38
unsigned long long int uint64
Definition: types.h:39
unsigned short uint16
Definition: types.h:35
int int32
Definition: types.h:36
unsigned int uint32
Definition: types.h:37
choose_int_types< my_pointer_size >::int_type int_type
Definition: types.h:63
unsigned_type internal_size_type
Definition: types.h:66
unsigned char uint8
Definition: types.h:33
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
char int8
Definition: types.h:32
uint64 external_size_type
Definition: types.h:67
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
Definition: types.h:64
#define STXXL_END_NAMESPACE
Definition: namespace.h:17