STXXL  1.4.0
 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 
20 
22 
23 
24 #if STXXL_MSVC
25 typedef __int8 int8;
26 typedef unsigned __int8 uint8;
27 typedef __int16 int16;
28 typedef unsigned __int16 uint16;
29 typedef __int32 int32;
30 typedef unsigned __int32 uint32;
31 typedef __int64 int64;
32 typedef unsigned __int64 uint64;
33 #else
34 typedef char int8;
35 typedef unsigned char uint8;
36 typedef short int16;
37 typedef unsigned short uint16;
38 typedef int int32;
39 typedef unsigned int uint32;
40 typedef long long int int64;
41 typedef unsigned long long int uint64;
42 #endif
43 
44 
45 // integer types declarations
46 enum { my_pointer_size = sizeof(void*) };
47 
48 template <int PtrSize>
50 { };
51 
52 template <>
53 struct choose_int_types<4> // for 32-bit processors/compilers
54 {
55  typedef int32 int_type;
57 };
58 
59 template <>
60 struct choose_int_types<8> // for 64-bit processors/compilers
61 {
62  typedef int64 int_type;
64 };
65 
68 
69 typedef unsigned_type internal_size_type; // fits in internal memory
70 typedef uint64 external_size_type; // may require external memory
71 
73 
74 #endif // !STXXL_COMMON_TYPES_HEADER
short int16
Definition: types.h:36
long long int int64
Definition: types.h:40
unsigned long long int uint64
Definition: types.h:41
unsigned short uint16
Definition: types.h:37
int int32
Definition: types.h:38
unsigned int uint32
Definition: types.h:39
choose_int_types< my_pointer_size >::int_type int_type
Definition: types.h:66
unsigned_type internal_size_type
Definition: types.h:69
unsigned char uint8
Definition: types.h:35
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
char int8
Definition: types.h:34
uint64 external_size_type
Definition: types.h:70
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
Definition: types.h:67
#define STXXL_END_NAMESPACE
Definition: namespace.h:17