X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Finteger_traits.hpp;h=94eb00d31e478c8ac02021fd90c9785b54719f65;hb=44cdffa39e9160bde46d824f1915f9ef3084b53e;hp=36aa4dc0decc168a751a0f1f2eafb2ea83844ec5;hpb=2349a51b124cafaf65ca673f8e7fd931f4ba4961;p=lyx.git diff --git a/boost/boost/integer_traits.hpp b/boost/boost/integer_traits.hpp index 36aa4dc0de..94eb00d31e 100644 --- a/boost/boost/integer_traits.hpp +++ b/boost/boost/integer_traits.hpp @@ -5,7 +5,7 @@ * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * - * $Id: integer_traits.hpp,v 1.25 2004/09/04 10:34:47 johnmaddock Exp $ + * $Id$ * * Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers */ @@ -21,10 +21,23 @@ // These are an implementation detail and not part of the interface #include -#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && !defined(BOOST_NO_CWCHAR) +// we need wchar.h for WCHAR_MAX/MIN but not all platforms provide it, +// and some may have but not ... +#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun) || defined(__QNX__)) #include #endif +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +// ../../../boost/integer_traits.hpp:164:66: warning: use of C99 long long integer constant +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif namespace boost { template @@ -86,7 +99,9 @@ class integer_traits template<> class integer_traits : public std::numeric_limits, -#if defined(WCHAR_MIN) && defined(WCHAR_MAX) + // Don't trust WCHAR_MIN and WCHAR_MAX with Mac OS X's native + // library: they are wrong! +#if defined(WCHAR_MIN) && defined(WCHAR_MAX) && !defined(__APPLE__) public detail::integer_traits_base #elif defined(__BORLANDC__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__BEOS__) && defined(__GNUC__)) // No WCHAR_MIN and WCHAR_MAX, whar_t is short and unsigned: @@ -96,6 +111,7 @@ class integer_traits || (defined(__OpenBSD__) && defined(__GNUC__))\ || (defined(__NetBSD__) && defined(__GNUC__))\ || (defined(__FreeBSD__) && defined(__GNUC__))\ + || (defined(__DragonFly__) && defined(__GNUC__))\ || (defined(__hpux) && defined(__GNUC__) && (__GNUC__ == 3) && !defined(__SGI_STL_PORT)) // No WCHAR_MIN and WCHAR_MAX, wchar_t has the same range as int. // - SGI MIPSpro with native library @@ -103,11 +119,6 @@ class integer_traits // - Mac OS X with native library // - gcc on FreeBSD, OpenBSD and NetBSD public detail::integer_traits_base -#elif defined(__hpux) && defined(__GNUC__) && (__GNUC__ == 2) && !defined(__SGI_STL_PORT) - // No WCHAR_MIN and WCHAR_MAX, wchar_t has the same range as unsigned int. - // - gcc 2.95.x on HP-UX - // (also, std::numeric_limits appears to return the wrong values). - public detail::integer_traits_base #else #error No WCHAR_MIN and WCHAR_MAX present, please adjust integer_traits<> for your compiler. #endif @@ -211,7 +222,7 @@ class integer_traits< ::boost::ulong_long_type> template<> class integer_traits< ::boost::long_long_type> : public std::numeric_limits< ::boost::long_long_type>, - public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) - 1)), ~(1LL << (sizeof(::boost::long_long_type) - 1))> + public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1)), ~(1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1))> { }; template<> @@ -220,6 +231,20 @@ class integer_traits< ::boost::ulong_long_type> public detail::integer_traits_base< ::boost::ulong_long_type, 0, ~0uLL> { }; +#elif defined(BOOST_HAS_MS_INT64) + +template<> +class integer_traits< __int64> + : public std::numeric_limits< __int64>, + public detail::integer_traits_base< __int64, _I64_MIN, _I64_MAX> +{ }; + +template<> +class integer_traits< unsigned __int64> + : public std::numeric_limits< unsigned __int64>, + public detail::integer_traits_base< unsigned __int64, 0, _UI64_MAX> +{ }; + #endif #endif