types.h

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  *
00008  *  Distributed under the Boost Software License, Version 1.0.
00009  *  (See accompanying file LICENSE_1_0.txt or copy at
00010  *  http://www.boost.org/LICENSE_1_0.txt)
00011  **************************************************************************/
00012 
00013 #ifndef STXXL_TYPES_HEADER
00014 #define STXXL_TYPES_HEADER
00015 
00016 #ifdef STXXL_BOOST_CONFIG
00017  #include <boost/config.hpp>
00018 #endif
00019 
00020 #include <stxxl/bits/namespace.h>
00021 
00022 
00023 __STXXL_BEGIN_NAMESPACE
00024 
00025 
00026 #ifdef STXXL_BOOST_CONFIG
00027  #ifdef BOOST_MSVC
00028 typedef __int64 int64;
00029 typedef unsigned __int64 uint64;
00030  #else
00031 typedef long long int int64;
00032 typedef unsigned long long uint64;
00033  #endif
00034 #else
00035 typedef long long int int64;
00036 typedef unsigned long long uint64;
00037 #endif
00038 
00039 
00040 // integer types declarations
00041 enum { my_pointer_size = sizeof(void *) };
00042 
00043 template <int PtrSize>
00044 struct choose_int_types
00045 { };
00046 
00047 template <>
00048 struct choose_int_types<4>  // for 32-bit processors/compilers
00049 {
00050     typedef int int_type;
00051     typedef unsigned unsigned_type;
00052 };
00053 
00054 template <>
00055 struct choose_int_types<8> // for 64-bit processors/compilers
00056 {
00057     typedef long long int int_type;
00058     typedef long long unsigned unsigned_type;
00059 };
00060 
00061 typedef choose_int_types<my_pointer_size>::int_type int_type;
00062 typedef choose_int_types<my_pointer_size>::unsigned_type unsigned_type;
00063 
00064 __STXXL_END_NAMESPACE
00065 
00066 #endif // !STXXL_TYPES_HEADER

Generated on Thu Jun 4 10:21:47 2009 for Stxxl by  doxygen 1.4.7