1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/limits.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,143 @@
1.4 +
1.5 +// (C) Copyright John maddock 1999.
1.6 +// (C) David Abrahams 2002. Distributed under the Boost
1.7 +// Software License, Version 1.0. (See accompanying file
1.8 +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
1.9 +//
1.10 +// use this header as a workaround for missing <limits>
1.11 +
1.12 +// See http://www.boost.org/libs/utility/limits.html for documentation.
1.13 +
1.14 +#ifndef BOOST_LIMITS
1.15 +#define BOOST_LIMITS
1.16 +
1.17 +#include <boost/config.hpp>
1.18 +
1.19 +#ifdef BOOST_NO_LIMITS
1.20 +# include <boost/detail/limits.hpp>
1.21 +#else
1.22 +# include <limits>
1.23 +#endif
1.24 +
1.25 +#if (defined(BOOST_HAS_LONG_LONG) && defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)) \
1.26 + || (defined(BOOST_HAS_MS_INT64) && defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS))
1.27 +// Add missing specializations for numeric_limits:
1.28 +#ifdef BOOST_HAS_MS_INT64
1.29 +# define BOOST_LLT __int64
1.30 +# define BOOST_ULLT unsigned __int64
1.31 +#else
1.32 +# define BOOST_LLT ::boost::long_long_type
1.33 +# define BOOST_ULLT ::boost::ulong_long_type
1.34 +#endif
1.35 +
1.36 +namespace std
1.37 +{
1.38 + template<>
1.39 + class numeric_limits<BOOST_LLT>
1.40 + {
1.41 + public:
1.42 +
1.43 + BOOST_STATIC_CONSTANT(bool, is_specialized = true);
1.44 +#ifdef BOOST_HAS_MS_INT64
1.45 + static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x8000000000000000i64; }
1.46 + static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x7FFFFFFFFFFFFFFFi64; }
1.47 +#elif defined(LLONG_MAX)
1.48 + static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MIN; }
1.49 + static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MAX; }
1.50 +#elif defined(LONGLONG_MAX)
1.51 + static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MIN; }
1.52 + static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MAX; }
1.53 +#else
1.54 + static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 1LL << (sizeof(BOOST_LLT) * CHAR_BIT - 1); }
1.55 + static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~(min)(); }
1.56 +#endif
1.57 + BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT -1);
1.58 + BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT) - 1) * 301L / 1000);
1.59 + BOOST_STATIC_CONSTANT(bool, is_signed = true);
1.60 + BOOST_STATIC_CONSTANT(bool, is_integer = true);
1.61 + BOOST_STATIC_CONSTANT(bool, is_exact = true);
1.62 + BOOST_STATIC_CONSTANT(int, radix = 2);
1.63 + static BOOST_LLT epsilon() throw() { return 0; };
1.64 + static BOOST_LLT round_error() throw() { return 0; };
1.65 +
1.66 + BOOST_STATIC_CONSTANT(int, min_exponent = 0);
1.67 + BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
1.68 + BOOST_STATIC_CONSTANT(int, max_exponent = 0);
1.69 + BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
1.70 +
1.71 + BOOST_STATIC_CONSTANT(bool, has_infinity = false);
1.72 + BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
1.73 + BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
1.74 + BOOST_STATIC_CONSTANT(bool, has_denorm = false);
1.75 + BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
1.76 + static BOOST_LLT infinity() throw() { return 0; };
1.77 + static BOOST_LLT quiet_NaN() throw() { return 0; };
1.78 + static BOOST_LLT signaling_NaN() throw() { return 0; };
1.79 + static BOOST_LLT denorm_min() throw() { return 0; };
1.80 +
1.81 + BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
1.82 + BOOST_STATIC_CONSTANT(bool, is_bounded = false);
1.83 + BOOST_STATIC_CONSTANT(bool, is_modulo = false);
1.84 +
1.85 + BOOST_STATIC_CONSTANT(bool, traps = false);
1.86 + BOOST_STATIC_CONSTANT(bool, tinyness_before = false);
1.87 + BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);
1.88 +
1.89 + };
1.90 +
1.91 + template<>
1.92 + class numeric_limits<BOOST_ULLT>
1.93 + {
1.94 + public:
1.95 +
1.96 + BOOST_STATIC_CONSTANT(bool, is_specialized = true);
1.97 +#ifdef BOOST_HAS_MS_INT64
1.98 + static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0ui64; }
1.99 + static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0xFFFFFFFFFFFFFFFFui64; }
1.100 +#elif defined(ULLONG_MAX) && defined(ULLONG_MIN)
1.101 + static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MIN; }
1.102 + static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MAX; }
1.103 +#elif defined(ULONGLONG_MAX) && defined(ULONGLONG_MIN)
1.104 + static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MIN; }
1.105 + static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MAX; }
1.106 +#else
1.107 + static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0uLL; }
1.108 + static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~0uLL; }
1.109 +#endif
1.110 + BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT);
1.111 + BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT)) * 301L / 1000);
1.112 + BOOST_STATIC_CONSTANT(bool, is_signed = false);
1.113 + BOOST_STATIC_CONSTANT(bool, is_integer = true);
1.114 + BOOST_STATIC_CONSTANT(bool, is_exact = true);
1.115 + BOOST_STATIC_CONSTANT(int, radix = 2);
1.116 + static BOOST_ULLT epsilon() throw() { return 0; };
1.117 + static BOOST_ULLT round_error() throw() { return 0; };
1.118 +
1.119 + BOOST_STATIC_CONSTANT(int, min_exponent = 0);
1.120 + BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
1.121 + BOOST_STATIC_CONSTANT(int, max_exponent = 0);
1.122 + BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
1.123 +
1.124 + BOOST_STATIC_CONSTANT(bool, has_infinity = false);
1.125 + BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
1.126 + BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
1.127 + BOOST_STATIC_CONSTANT(bool, has_denorm = false);
1.128 + BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
1.129 + static BOOST_ULLT infinity() throw() { return 0; };
1.130 + static BOOST_ULLT quiet_NaN() throw() { return 0; };
1.131 + static BOOST_ULLT signaling_NaN() throw() { return 0; };
1.132 + static BOOST_ULLT denorm_min() throw() { return 0; };
1.133 +
1.134 + BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
1.135 + BOOST_STATIC_CONSTANT(bool, is_bounded = false);
1.136 + BOOST_STATIC_CONSTANT(bool, is_modulo = false);
1.137 +
1.138 + BOOST_STATIC_CONSTANT(bool, traps = false);
1.139 + BOOST_STATIC_CONSTANT(bool, tinyness_before = false);
1.140 + BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);
1.141 +
1.142 + };
1.143 +}
1.144 +#endif
1.145 +
1.146 +#endif