epoc32/include/stdapis/boost/cstdint.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/cstdint.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,446 @@
     1.4 +//  boost cstdint.hpp header file  ------------------------------------------//
     1.5 +
     1.6 +//  (C) Copyright Beman Dawes 1999. 
     1.7 +//  (C) Copyright Jens Mauer 2001  
     1.8 +//  (C) Copyright John Maddock 2001 
     1.9 +//  Distributed under the Boost
    1.10 +//  Software License, Version 1.0. (See accompanying file
    1.11 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    1.12 +
    1.13 +//  See http://www.boost.org/libs/integer for documentation.
    1.14 +
    1.15 +//  Revision History
    1.16 +//   31 Oct 01  use BOOST_HAS_LONG_LONG to check for "long long" (Jens M.)
    1.17 +//   16 Apr 01  check LONGLONG_MAX when looking for "long long" (Jens Maurer)
    1.18 +//   23 Jan 01  prefer "long" over "int" for int32_t and intmax_t (Jens Maurer)
    1.19 +//   12 Nov 00  Merged <boost/stdint.h> (Jens Maurer)
    1.20 +//   23 Sep 00  Added INTXX_C macro support (John Maddock).
    1.21 +//   22 Sep 00  Better 64-bit support (John Maddock)
    1.22 +//   29 Jun 00  Reimplement to avoid including stdint.h within namespace boost
    1.23 +//    8 Aug 99  Initial version (Beman Dawes)
    1.24 +
    1.25 +
    1.26 +#ifndef BOOST_CSTDINT_HPP
    1.27 +#define BOOST_CSTDINT_HPP
    1.28 +
    1.29 +#include <boost/config.hpp>
    1.30 +
    1.31 +
    1.32 +#ifdef BOOST_HAS_STDINT_H
    1.33 +
    1.34 +// The following #include is an implementation artifact; not part of interface.
    1.35 +# ifdef __hpux
    1.36 +// HP-UX has a vaguely nice <stdint.h> in a non-standard location
    1.37 +#   include <inttypes.h>
    1.38 +#   ifdef __STDC_32_MODE__
    1.39 +      // this is triggered with GCC, because it defines __cplusplus < 199707L
    1.40 +#     define BOOST_NO_INT64_T
    1.41 +#   endif 
    1.42 +# elif defined(__FreeBSD__) || defined(__IBMCPP__)
    1.43 +#   include <inttypes.h>
    1.44 +# else
    1.45 +#   include <stdint.h>
    1.46 +
    1.47 +// There is a bug in Cygwin two _C macros
    1.48 +#   if defined(__STDC_CONSTANT_MACROS) && defined(__CYGWIN__)
    1.49 +#     undef INTMAX_C
    1.50 +#     undef UINTMAX_C
    1.51 +#     define INTMAX_C(c) c##LL
    1.52 +#     define UINTMAX_C(c) c##ULL
    1.53 +#   endif
    1.54 +
    1.55 +# endif
    1.56 +
    1.57 +#ifdef __QNX__
    1.58 +
    1.59 +// QNX (Dinkumware stdlib) defines these as non-standard names.
    1.60 +// Reflect to the standard names.
    1.61 +
    1.62 +typedef ::intleast8_t int_least8_t;
    1.63 +typedef ::intfast8_t int_fast8_t;
    1.64 +typedef ::uintleast8_t uint_least8_t;
    1.65 +typedef ::uintfast8_t uint_fast8_t;
    1.66 +
    1.67 +typedef ::intleast16_t int_least16_t;
    1.68 +typedef ::intfast16_t int_fast16_t;
    1.69 +typedef ::uintleast16_t uint_least16_t;
    1.70 +typedef ::uintfast16_t uint_fast16_t;
    1.71 +
    1.72 +typedef ::intleast32_t int_least32_t;
    1.73 +typedef ::intfast32_t int_fast32_t;
    1.74 +typedef ::uintleast32_t uint_least32_t;
    1.75 +typedef ::uintfast32_t uint_fast32_t;
    1.76 +
    1.77 +# ifndef BOOST_NO_INT64_T
    1.78 +
    1.79 +typedef ::intleast64_t int_least64_t;
    1.80 +typedef ::intfast64_t int_fast64_t;
    1.81 +typedef ::uintleast64_t uint_least64_t;
    1.82 +typedef ::uintfast64_t uint_fast64_t;
    1.83 +
    1.84 +# endif
    1.85 +
    1.86 +#endif
    1.87 +
    1.88 +namespace boost
    1.89 +{
    1.90 +
    1.91 +  using ::int8_t;             
    1.92 +  using ::int_least8_t;       
    1.93 +  using ::int_fast8_t;        
    1.94 +  using ::uint8_t;            
    1.95 +  using ::uint_least8_t;      
    1.96 +  using ::uint_fast8_t;       
    1.97 +                     
    1.98 +  using ::int16_t;            
    1.99 +  using ::int_least16_t;      
   1.100 +  using ::int_fast16_t;       
   1.101 +  using ::uint16_t;           
   1.102 +  using ::uint_least16_t;     
   1.103 +  using ::uint_fast16_t;      
   1.104 +                     
   1.105 +  using ::int32_t;            
   1.106 +  using ::int_least32_t;      
   1.107 +  using ::int_fast32_t;       
   1.108 +  using ::uint32_t;           
   1.109 +  using ::uint_least32_t;     
   1.110 +  using ::uint_fast32_t;      
   1.111 +                     
   1.112 +# ifndef BOOST_NO_INT64_T
   1.113 +
   1.114 +  using ::int64_t;            
   1.115 +  using ::int_least64_t;      
   1.116 +  using ::int_fast64_t;       
   1.117 +  using ::uint64_t;           
   1.118 +  using ::uint_least64_t;     
   1.119 +  using ::uint_fast64_t;      
   1.120 +                     
   1.121 +# endif
   1.122 +
   1.123 +  using ::intmax_t;      
   1.124 +  using ::uintmax_t;     
   1.125 +
   1.126 +} // namespace boost
   1.127 +
   1.128 +#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__)
   1.129 +// FreeBSD and Tru64 have an <inttypes.h> that contains much of what we need.
   1.130 +# include <inttypes.h>
   1.131 +
   1.132 +namespace boost {
   1.133 +
   1.134 +  using ::int8_t;             
   1.135 +  typedef int8_t int_least8_t;       
   1.136 +  typedef int8_t int_fast8_t;        
   1.137 +  using ::uint8_t;            
   1.138 +  typedef uint8_t uint_least8_t;      
   1.139 +  typedef uint8_t uint_fast8_t;       
   1.140 +                     
   1.141 +  using ::int16_t;            
   1.142 +  typedef int16_t int_least16_t;      
   1.143 +  typedef int16_t int_fast16_t;       
   1.144 +  using ::uint16_t;           
   1.145 +  typedef uint16_t uint_least16_t;     
   1.146 +  typedef uint16_t uint_fast16_t;      
   1.147 +                     
   1.148 +  using ::int32_t;            
   1.149 +  typedef int32_t int_least32_t;      
   1.150 +  typedef int32_t int_fast32_t;       
   1.151 +  using ::uint32_t;           
   1.152 +  typedef uint32_t uint_least32_t;     
   1.153 +  typedef uint32_t uint_fast32_t;      
   1.154 +         
   1.155 +# ifndef BOOST_NO_INT64_T          
   1.156 +
   1.157 +  using ::int64_t;            
   1.158 +  typedef int64_t int_least64_t;      
   1.159 +  typedef int64_t int_fast64_t;       
   1.160 +  using ::uint64_t;           
   1.161 +  typedef uint64_t uint_least64_t;     
   1.162 +  typedef uint64_t uint_fast64_t;      
   1.163 +
   1.164 +  typedef int64_t intmax_t;
   1.165 +  typedef uint64_t uintmax_t;
   1.166 +
   1.167 +# else
   1.168 +
   1.169 +  typedef int32_t intmax_t;
   1.170 +  typedef uint32_t uintmax_t;
   1.171 +
   1.172 +# endif
   1.173 +
   1.174 +} // namespace boost
   1.175 +
   1.176 +#else  // BOOST_HAS_STDINT_H
   1.177 +
   1.178 +# include <boost/limits.hpp> // implementation artifact; not part of interface
   1.179 +# include <limits.h>         // needed for limits macros
   1.180 +
   1.181 +
   1.182 +namespace boost
   1.183 +{
   1.184 +
   1.185 +//  These are fairly safe guesses for some 16-bit, and most 32-bit and 64-bit
   1.186 +//  platforms.  For other systems, they will have to be hand tailored.
   1.187 +//
   1.188 +//  Because the fast types are assumed to be the same as the undecorated types,
   1.189 +//  it may be possible to hand tailor a more efficient implementation.  Such
   1.190 +//  an optimization may be illusionary; on the Intel x86-family 386 on, for
   1.191 +//  example, byte arithmetic and load/stores are as fast as "int" sized ones.
   1.192 +
   1.193 +//  8-bit types  ------------------------------------------------------------//
   1.194 +
   1.195 +# if UCHAR_MAX == 0xff
   1.196 +     typedef signed char     int8_t;
   1.197 +     typedef signed char     int_least8_t;
   1.198 +     typedef signed char     int_fast8_t;
   1.199 +     typedef unsigned char   uint8_t;
   1.200 +     typedef unsigned char   uint_least8_t;
   1.201 +     typedef unsigned char   uint_fast8_t;
   1.202 +# else
   1.203 +#    error defaults not correct; you must hand modify boost/cstdint.hpp
   1.204 +# endif
   1.205 +
   1.206 +//  16-bit types  -----------------------------------------------------------//
   1.207 +
   1.208 +# if USHRT_MAX == 0xffff
   1.209 +#  if defined(__crayx1)
   1.210 +     // The Cray X1 has a 16-bit short, however it is not recommend
   1.211 +     // for use in performance critical code.
   1.212 +     typedef short           int16_t;
   1.213 +     typedef short           int_least16_t;
   1.214 +     typedef int             int_fast16_t;
   1.215 +     typedef unsigned short  uint16_t;
   1.216 +     typedef unsigned short  uint_least16_t;
   1.217 +     typedef unsigned int    uint_fast16_t;
   1.218 +#  else
   1.219 +     typedef short           int16_t;
   1.220 +     typedef short           int_least16_t;
   1.221 +     typedef short           int_fast16_t;
   1.222 +     typedef unsigned short  uint16_t;
   1.223 +     typedef unsigned short  uint_least16_t;
   1.224 +     typedef unsigned short  uint_fast16_t;
   1.225 +#  endif
   1.226 +# elif (USHRT_MAX == 0xffffffff) && defined(CRAY)
   1.227 +     // no 16-bit types on Cray:
   1.228 +     typedef short           int_least16_t;
   1.229 +     typedef short           int_fast16_t;
   1.230 +     typedef unsigned short  uint_least16_t;
   1.231 +     typedef unsigned short  uint_fast16_t;
   1.232 +# else
   1.233 +#    error defaults not correct; you must hand modify boost/cstdint.hpp
   1.234 +# endif
   1.235 +
   1.236 +//  32-bit types  -----------------------------------------------------------//
   1.237 +
   1.238 +# if ULONG_MAX == 0xffffffff
   1.239 +     typedef long            int32_t;
   1.240 +     typedef long            int_least32_t;
   1.241 +     typedef long            int_fast32_t;
   1.242 +     typedef unsigned long   uint32_t;
   1.243 +     typedef unsigned long   uint_least32_t;
   1.244 +     typedef unsigned long   uint_fast32_t;
   1.245 +# elif UINT_MAX == 0xffffffff
   1.246 +     typedef int             int32_t;
   1.247 +     typedef int             int_least32_t;
   1.248 +     typedef int             int_fast32_t;
   1.249 +     typedef unsigned int    uint32_t;
   1.250 +     typedef unsigned int    uint_least32_t;
   1.251 +     typedef unsigned int    uint_fast32_t;
   1.252 +# else
   1.253 +#    error defaults not correct; you must hand modify boost/cstdint.hpp
   1.254 +# endif
   1.255 +
   1.256 +//  64-bit types + intmax_t and uintmax_t  ----------------------------------//
   1.257 +
   1.258 +# if defined(BOOST_HAS_LONG_LONG) && \
   1.259 +   !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \
   1.260 +   (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \
   1.261 +   (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
   1.262 +#    if defined(__hpux)
   1.263 +     // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions
   1.264 +#    elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL)
   1.265 +                                                                 // 2**64 - 1
   1.266 +#    else
   1.267 +#       error defaults not correct; you must hand modify boost/cstdint.hpp
   1.268 +#    endif
   1.269 +
   1.270 +     typedef  ::boost::long_long_type            intmax_t;
   1.271 +     typedef  ::boost::ulong_long_type   uintmax_t;
   1.272 +     typedef  ::boost::long_long_type            int64_t;
   1.273 +     typedef  ::boost::long_long_type            int_least64_t;
   1.274 +     typedef  ::boost::long_long_type            int_fast64_t;
   1.275 +     typedef  ::boost::ulong_long_type   uint64_t;
   1.276 +     typedef  ::boost::ulong_long_type   uint_least64_t;
   1.277 +     typedef  ::boost::ulong_long_type   uint_fast64_t;
   1.278 +
   1.279 +# elif ULONG_MAX != 0xffffffff
   1.280 +
   1.281 +#    if ULONG_MAX == 18446744073709551615 // 2**64 - 1
   1.282 +     typedef long                 intmax_t;
   1.283 +     typedef unsigned long        uintmax_t;
   1.284 +     typedef long                 int64_t;
   1.285 +     typedef long                 int_least64_t;
   1.286 +     typedef long                 int_fast64_t;
   1.287 +     typedef unsigned long        uint64_t;
   1.288 +     typedef unsigned long        uint_least64_t;
   1.289 +     typedef unsigned long        uint_fast64_t;
   1.290 +#    else
   1.291 +#       error defaults not correct; you must hand modify boost/cstdint.hpp
   1.292 +#    endif
   1.293 +# elif defined(__GNUC__) && defined(BOOST_HAS_LONG_LONG)
   1.294 +     __extension__ typedef long long            intmax_t;
   1.295 +     __extension__ typedef unsigned long long   uintmax_t;
   1.296 +     __extension__ typedef long long            int64_t;
   1.297 +     __extension__ typedef long long            int_least64_t;
   1.298 +     __extension__ typedef long long            int_fast64_t;
   1.299 +     __extension__ typedef unsigned long long   uint64_t;
   1.300 +     __extension__ typedef unsigned long long   uint_least64_t;
   1.301 +     __extension__ typedef unsigned long long   uint_fast64_t;
   1.302 +# elif defined(BOOST_HAS_MS_INT64)
   1.303 +     //
   1.304 +     // we have Borland/Intel/Microsoft __int64:
   1.305 +     //
   1.306 +     typedef __int64             intmax_t;
   1.307 +     typedef unsigned __int64    uintmax_t;
   1.308 +     typedef __int64             int64_t;
   1.309 +     typedef __int64             int_least64_t;
   1.310 +     typedef __int64             int_fast64_t;
   1.311 +     typedef unsigned __int64    uint64_t;
   1.312 +     typedef unsigned __int64    uint_least64_t;
   1.313 +     typedef unsigned __int64    uint_fast64_t;
   1.314 +# else // assume no 64-bit integers
   1.315 +#  define BOOST_NO_INT64_T
   1.316 +     typedef int32_t              intmax_t;
   1.317 +     typedef uint32_t             uintmax_t;
   1.318 +# endif
   1.319 +
   1.320 +} // namespace boost
   1.321 +
   1.322 +
   1.323 +#endif // BOOST_HAS_STDINT_H
   1.324 +
   1.325 +#endif // BOOST_CSTDINT_HPP
   1.326 +
   1.327 +
   1.328 +/****************************************************
   1.329 +
   1.330 +Macro definition section:
   1.331 +
   1.332 +Define various INTXX_C macros only if
   1.333 +__STDC_CONSTANT_MACROS is defined.
   1.334 +
   1.335 +Undefine the macros if __STDC_CONSTANT_MACROS is
   1.336 +not defined and the macros are (cf <cassert>).
   1.337 +
   1.338 +Added 23rd September 2000 (John Maddock).
   1.339 +Modified 11th September 2001 to be excluded when
   1.340 +BOOST_HAS_STDINT_H is defined (John Maddock).
   1.341 +
   1.342 +******************************************************/
   1.343 +
   1.344 +#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H)
   1.345 +# define BOOST__STDC_CONSTANT_MACROS_DEFINED
   1.346 +# if defined(BOOST_HAS_MS_INT64)
   1.347 +//
   1.348 +// Borland/Intel/Microsoft compilers have width specific suffixes:
   1.349 +//
   1.350 +#  define INT8_C(value)     value##i8
   1.351 +#  define INT16_C(value)    value##i16
   1.352 +#  define INT32_C(value)    value##i32
   1.353 +#  define INT64_C(value)    value##i64
   1.354 +#  ifdef __BORLANDC__
   1.355 +    // Borland bug: appending ui8 makes the type a signed char
   1.356 +#   define UINT8_C(value)    static_cast<unsigned char>(value##u)
   1.357 +#  else
   1.358 +#   define UINT8_C(value)    value##ui8
   1.359 +#  endif
   1.360 +#  define UINT16_C(value)   value##ui16
   1.361 +#  define UINT32_C(value)   value##ui32
   1.362 +#  define UINT64_C(value)   value##ui64
   1.363 +#  define INTMAX_C(value)   value##i64
   1.364 +#  define UINTMAX_C(value)  value##ui64
   1.365 +
   1.366 +# else
   1.367 +//  do it the old fashioned way:
   1.368 +
   1.369 +//  8-bit types  ------------------------------------------------------------//
   1.370 +
   1.371 +#  if UCHAR_MAX == 0xff
   1.372 +#   define INT8_C(value) static_cast<boost::int8_t>(value)
   1.373 +#   define UINT8_C(value) static_cast<boost::uint8_t>(value##u)
   1.374 +#  endif
   1.375 +
   1.376 +//  16-bit types  -----------------------------------------------------------//
   1.377 +
   1.378 +#  if USHRT_MAX == 0xffff
   1.379 +#   define INT16_C(value) static_cast<boost::int16_t>(value)
   1.380 +#   define UINT16_C(value) static_cast<boost::uint16_t>(value##u)
   1.381 +#  endif
   1.382 +
   1.383 +//  32-bit types  -----------------------------------------------------------//
   1.384 +
   1.385 +#  if UINT_MAX == 0xffffffff
   1.386 +#   define INT32_C(value) value
   1.387 +#   define UINT32_C(value) value##u
   1.388 +#  elif ULONG_MAX == 0xffffffff
   1.389 +#   define INT32_C(value) value##L
   1.390 +#   define UINT32_C(value) value##uL
   1.391 +#  endif
   1.392 +
   1.393 +//  64-bit types + intmax_t and uintmax_t  ----------------------------------//
   1.394 +
   1.395 +#  if defined(BOOST_HAS_LONG_LONG) && \
   1.396 +    (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
   1.397 +
   1.398 +#    if defined(__hpux)
   1.399 +     // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions
   1.400 +#    elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) ||  \
   1.401 +        (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) ||  \
   1.402 +        (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U)
   1.403 +
   1.404 +#    else
   1.405 +#       error defaults not correct; you must hand modify boost/cstdint.hpp
   1.406 +#    endif
   1.407 +#    define INT64_C(value) value##LL
   1.408 +#    define UINT64_C(value) value##uLL
   1.409 +#  elif ULONG_MAX != 0xffffffff
   1.410 +
   1.411 +#    if ULONG_MAX == 18446744073709551615 // 2**64 - 1
   1.412 +#       define INT64_C(value) value##L
   1.413 +#       define UINT64_C(value) value##uL
   1.414 +#    else
   1.415 +#       error defaults not correct; you must hand modify boost/cstdint.hpp
   1.416 +#    endif
   1.417 +#  endif
   1.418 +
   1.419 +#  ifdef BOOST_NO_INT64_T
   1.420 +#   define INTMAX_C(value) INT32_C(value)
   1.421 +#   define UINTMAX_C(value) UINT32_C(value)
   1.422 +#  else
   1.423 +#   define INTMAX_C(value) INT64_C(value)
   1.424 +#   define UINTMAX_C(value) UINT64_C(value)
   1.425 +#  endif
   1.426 +
   1.427 +# endif // Borland/Microsoft specific width suffixes
   1.428 +
   1.429 +
   1.430 +#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) && !defined(BOOST_HAS_STDINT_H)
   1.431 +//
   1.432 +// undef all the macros:
   1.433 +//
   1.434 +# undef INT8_C
   1.435 +# undef INT16_C
   1.436 +# undef INT32_C
   1.437 +# undef INT64_C
   1.438 +# undef UINT8_C
   1.439 +# undef UINT16_C
   1.440 +# undef UINT32_C
   1.441 +# undef UINT64_C
   1.442 +# undef INTMAX_C
   1.443 +# undef UINTMAX_C
   1.444 +
   1.445 +#endif // __STDC_CONSTANT_MACROS_DEFINED etc.
   1.446 +
   1.447 +
   1.448 +
   1.449 +