]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/integer_traits.hpp
ctests: uninvert some XeTeX tests that are fixed
[lyx.git] / boost / boost / integer_traits.hpp
index 2accb2f63f56ef42f87b8d33e4306ace525fe883..94eb00d31e478c8ac02021fd90c9785b54719f65 100644 (file)
@@ -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.30 2006/02/05 10:19:42 johnmaddock Exp $
+ * $Id$
  *
  * Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers
  */
 #include <wchar.h>
 #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<class T>
@@ -108,11 +119,6 @@ class integer_traits<wchar_t>
     //  - Mac OS X with native library
     //  - gcc on FreeBSD, OpenBSD and NetBSD
     public detail::integer_traits_base<wchar_t, INT_MIN, INT_MAX>
-#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<wchar_t> appears to return the wrong values).
-    public detail::integer_traits_base<wchar_t, 0, UINT_MAX>
 #else
 #error No WCHAR_MIN and WCHAR_MAX present, please adjust integer_traits<> for your compiler.
 #endif
@@ -216,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<>
@@ -225,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