Stxxl
1.4.0
|
00001 /*************************************************************************** 00002 * include/stxxl/bits/common/types.h 00003 * 00004 * Part of the STXXL. See http://stxxl.sourceforge.net 00005 * 00006 * Copyright (C) 2007 Roman Dementiev <dementiev@ira.uka.de> 00007 * Copyright (C) 2010 Andreas Beckmann <beckmann@cs.uni-frankfurt.de> 00008 * 00009 * Distributed under the Boost Software License, Version 1.0. 00010 * (See accompanying file LICENSE_1_0.txt or copy at 00011 * http://www.boost.org/LICENSE_1_0.txt) 00012 **************************************************************************/ 00013 00014 #ifndef STXXL_TYPES_HEADER 00015 #define STXXL_TYPES_HEADER 00016 00017 #ifdef STXXL_BOOST_CONFIG 00018 #include <boost/config.hpp> 00019 #endif 00020 00021 #include <stxxl/bits/namespace.h> 00022 00023 00024 __STXXL_BEGIN_NAMESPACE 00025 00026 00027 #ifdef STXXL_BOOST_CONFIG 00028 #ifdef BOOST_MSVC 00029 typedef __int64 int64; 00030 typedef unsigned __int64 uint64; 00031 #else 00032 typedef long long int int64; 00033 typedef unsigned long long int uint64; 00034 #endif 00035 #else 00036 typedef long long int int64; 00037 typedef unsigned long long int uint64; 00038 #endif 00039 00040 00041 // integer types declarations 00042 enum { my_pointer_size = sizeof(void *) }; 00043 00044 template <int PtrSize> 00045 struct choose_int_types 00046 { }; 00047 00048 template <> 00049 struct choose_int_types<4> // for 32-bit processors/compilers 00050 { 00051 typedef int int_type; 00052 typedef unsigned unsigned_type; 00053 }; 00054 00055 template <> 00056 struct choose_int_types<8> // for 64-bit processors/compilers 00057 { 00058 typedef int64 int_type; 00059 typedef uint64 unsigned_type; 00060 }; 00061 00062 typedef choose_int_types<my_pointer_size>::int_type int_type; 00063 typedef choose_int_types<my_pointer_size>::unsigned_type unsigned_type; 00064 00065 typedef unsigned_type internal_size_type; // fits in internal memory 00066 typedef uint64 external_size_type; // may require external memory 00067 00068 __STXXL_END_NAMESPACE 00069 00070 #endif // !STXXL_TYPES_HEADER