OSDN Git Service

Add boost/cstdint.hpp
authorsdottaka <none@none>
Wed, 4 Sep 2013 15:10:09 +0000 (00:10 +0900)
committersdottaka <none@none>
Wed, 4 Sep 2013 15:10:09 +0000 (00:10 +0900)
Externals/boost/boost/cstdint.hpp [new file with mode: 0644]

diff --git a/Externals/boost/boost/cstdint.hpp b/Externals/boost/boost/cstdint.hpp
new file mode 100644 (file)
index 0000000..c6a8656
--- /dev/null
@@ -0,0 +1,508 @@
+//  boost cstdint.hpp header file  ------------------------------------------//\r
+\r
+//  (C) Copyright Beman Dawes 1999. \r
+//  (C) Copyright Jens Mauer 2001  \r
+//  (C) Copyright John Maddock 2001 \r
+//  Distributed under the Boost\r
+//  Software License, Version 1.0. (See accompanying file\r
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+//  See http://www.boost.org/libs/integer for documentation.\r
+\r
+//  Revision History\r
+//   31 Oct 01  use BOOST_HAS_LONG_LONG to check for "long long" (Jens M.)\r
+//   16 Apr 01  check LONGLONG_MAX when looking for "long long" (Jens Maurer)\r
+//   23 Jan 01  prefer "long" over "int" for int32_t and intmax_t (Jens Maurer)\r
+//   12 Nov 00  Merged <boost/stdint.h> (Jens Maurer)\r
+//   23 Sep 00  Added INTXX_C macro support (John Maddock).\r
+//   22 Sep 00  Better 64-bit support (John Maddock)\r
+//   29 Jun 00  Reimplement to avoid including stdint.h within namespace boost\r
+//    8 Aug 99  Initial version (Beman Dawes)\r
+\r
+\r
+#ifndef BOOST_CSTDINT_HPP\r
+#define BOOST_CSTDINT_HPP\r
+\r
+//\r
+// Since we always define the INT#_C macros as per C++0x, \r
+// define __STDC_CONSTANT_MACROS so that <stdint.h> does the right\r
+// thing if possible, and so that the user knows that the macros \r
+// are actually defined as per C99.\r
+//\r
+#ifndef __STDC_CONSTANT_MACROS\r
+#  define __STDC_CONSTANT_MACROS\r
+#endif\r
+\r
+#include <boost/config.hpp>\r
+\r
+//\r
+// Note that GLIBC is a bit inconsistent about whether int64_t is defined or not\r
+// depending upon what headers happen to have been included first...\r
+// so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG.\r
+// See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990\r
+//\r
+#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG))\r
+\r
+// The following #include is an implementation artifact; not part of interface.\r
+# ifdef __hpux\r
+// HP-UX has a vaguely nice <stdint.h> in a non-standard location\r
+#   include <inttypes.h>\r
+#   ifdef __STDC_32_MODE__\r
+      // this is triggered with GCC, because it defines __cplusplus < 199707L\r
+#     define BOOST_NO_INT64_T\r
+#   endif \r
+# elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX)\r
+#   include <inttypes.h>\r
+# else\r
+#   include <stdint.h>\r
+\r
+// There is a bug in Cygwin two _C macros\r
+#   if defined(__STDC_CONSTANT_MACROS) && defined(__CYGWIN__)\r
+#     undef INTMAX_C\r
+#     undef UINTMAX_C\r
+#     define INTMAX_C(c) c##LL\r
+#     define UINTMAX_C(c) c##ULL\r
+#   endif\r
+\r
+# endif\r
+\r
+#ifdef __QNX__\r
+\r
+// QNX (Dinkumware stdlib) defines these as non-standard names.\r
+// Reflect to the standard names.\r
+\r
+typedef ::intleast8_t int_least8_t;\r
+typedef ::intfast8_t int_fast8_t;\r
+typedef ::uintleast8_t uint_least8_t;\r
+typedef ::uintfast8_t uint_fast8_t;\r
+\r
+typedef ::intleast16_t int_least16_t;\r
+typedef ::intfast16_t int_fast16_t;\r
+typedef ::uintleast16_t uint_least16_t;\r
+typedef ::uintfast16_t uint_fast16_t;\r
+\r
+typedef ::intleast32_t int_least32_t;\r
+typedef ::intfast32_t int_fast32_t;\r
+typedef ::uintleast32_t uint_least32_t;\r
+typedef ::uintfast32_t uint_fast32_t;\r
+\r
+# ifndef BOOST_NO_INT64_T\r
+\r
+typedef ::intleast64_t int_least64_t;\r
+typedef ::intfast64_t int_fast64_t;\r
+typedef ::uintleast64_t uint_least64_t;\r
+typedef ::uintfast64_t uint_fast64_t;\r
+\r
+# endif\r
+\r
+#endif\r
+\r
+namespace boost\r
+{\r
+\r
+  using ::int8_t;             \r
+  using ::int_least8_t;       \r
+  using ::int_fast8_t;        \r
+  using ::uint8_t;            \r
+  using ::uint_least8_t;      \r
+  using ::uint_fast8_t;       \r
+                     \r
+  using ::int16_t;            \r
+  using ::int_least16_t;      \r
+  using ::int_fast16_t;       \r
+  using ::uint16_t;           \r
+  using ::uint_least16_t;     \r
+  using ::uint_fast16_t;      \r
+                     \r
+  using ::int32_t;            \r
+  using ::int_least32_t;      \r
+  using ::int_fast32_t;       \r
+  using ::uint32_t;           \r
+  using ::uint_least32_t;     \r
+  using ::uint_fast32_t;      \r
+                     \r
+# ifndef BOOST_NO_INT64_T\r
+\r
+  using ::int64_t;            \r
+  using ::int_least64_t;      \r
+  using ::int_fast64_t;       \r
+  using ::uint64_t;           \r
+  using ::uint_least64_t;     \r
+  using ::uint_fast64_t;      \r
+                     \r
+# endif\r
+\r
+  using ::intmax_t;      \r
+  using ::uintmax_t;     \r
+\r
+} // namespace boost\r
+\r
+#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) || defined(__VMS)\r
+// FreeBSD and Tru64 have an <inttypes.h> that contains much of what we need.\r
+# include <inttypes.h>\r
+\r
+namespace boost {\r
+\r
+  using ::int8_t;             \r
+  typedef int8_t int_least8_t;       \r
+  typedef int8_t int_fast8_t;        \r
+  using ::uint8_t;            \r
+  typedef uint8_t uint_least8_t;      \r
+  typedef uint8_t uint_fast8_t;       \r
+                     \r
+  using ::int16_t;            \r
+  typedef int16_t int_least16_t;      \r
+  typedef int16_t int_fast16_t;       \r
+  using ::uint16_t;           \r
+  typedef uint16_t uint_least16_t;     \r
+  typedef uint16_t uint_fast16_t;      \r
+                     \r
+  using ::int32_t;            \r
+  typedef int32_t int_least32_t;      \r
+  typedef int32_t int_fast32_t;       \r
+  using ::uint32_t;           \r
+  typedef uint32_t uint_least32_t;     \r
+  typedef uint32_t uint_fast32_t;      \r
+         \r
+# ifndef BOOST_NO_INT64_T          \r
+\r
+  using ::int64_t;            \r
+  typedef int64_t int_least64_t;      \r
+  typedef int64_t int_fast64_t;       \r
+  using ::uint64_t;           \r
+  typedef uint64_t uint_least64_t;     \r
+  typedef uint64_t uint_fast64_t;      \r
+\r
+  typedef int64_t intmax_t;\r
+  typedef uint64_t uintmax_t;\r
+\r
+# else\r
+\r
+  typedef int32_t intmax_t;\r
+  typedef uint32_t uintmax_t;\r
+\r
+# endif\r
+\r
+} // namespace boost\r
+\r
+#else  // BOOST_HAS_STDINT_H\r
+\r
+# include <boost/limits.hpp> // implementation artifact; not part of interface\r
+# include <limits.h>         // needed for limits macros\r
+\r
+\r
+namespace boost\r
+{\r
+\r
+//  These are fairly safe guesses for some 16-bit, and most 32-bit and 64-bit\r
+//  platforms.  For other systems, they will have to be hand tailored.\r
+//\r
+//  Because the fast types are assumed to be the same as the undecorated types,\r
+//  it may be possible to hand tailor a more efficient implementation.  Such\r
+//  an optimization may be illusionary; on the Intel x86-family 386 on, for\r
+//  example, byte arithmetic and load/stores are as fast as "int" sized ones.\r
+\r
+//  8-bit types  ------------------------------------------------------------//\r
+\r
+# if UCHAR_MAX == 0xff\r
+     typedef signed char     int8_t;\r
+     typedef signed char     int_least8_t;\r
+     typedef signed char     int_fast8_t;\r
+     typedef unsigned char   uint8_t;\r
+     typedef unsigned char   uint_least8_t;\r
+     typedef unsigned char   uint_fast8_t;\r
+# else\r
+#    error defaults not correct; you must hand modify boost/cstdint.hpp\r
+# endif\r
+\r
+//  16-bit types  -----------------------------------------------------------//\r
+\r
+# if USHRT_MAX == 0xffff\r
+#  if defined(__crayx1)\r
+     // The Cray X1 has a 16-bit short, however it is not recommend\r
+     // for use in performance critical code.\r
+     typedef short           int16_t;\r
+     typedef short           int_least16_t;\r
+     typedef int             int_fast16_t;\r
+     typedef unsigned short  uint16_t;\r
+     typedef unsigned short  uint_least16_t;\r
+     typedef unsigned int    uint_fast16_t;\r
+#  else\r
+     typedef short           int16_t;\r
+     typedef short           int_least16_t;\r
+     typedef short           int_fast16_t;\r
+     typedef unsigned short  uint16_t;\r
+     typedef unsigned short  uint_least16_t;\r
+     typedef unsigned short  uint_fast16_t;\r
+#  endif\r
+# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) \r
+      // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified \r
+      // MTA / XMT does support the following non-standard integer types \r
+      typedef __short16           int16_t; \r
+      typedef __short16           int_least16_t; \r
+      typedef __short16           int_fast16_t; \r
+      typedef unsigned __short16  uint16_t; \r
+      typedef unsigned __short16  uint_least16_t; \r
+      typedef unsigned __short16  uint_fast16_t; \r
+# elif (USHRT_MAX == 0xffffffff) && defined(CRAY)\r
+     // no 16-bit types on Cray:\r
+     typedef short           int_least16_t;\r
+     typedef short           int_fast16_t;\r
+     typedef unsigned short  uint_least16_t;\r
+     typedef unsigned short  uint_fast16_t;\r
+# else\r
+#    error defaults not correct; you must hand modify boost/cstdint.hpp\r
+# endif\r
+\r
+//  32-bit types  -----------------------------------------------------------//\r
+\r
+# if UINT_MAX == 0xffffffff\r
+     typedef int             int32_t;\r
+     typedef int             int_least32_t;\r
+     typedef int             int_fast32_t;\r
+     typedef unsigned int    uint32_t;\r
+     typedef unsigned int    uint_least32_t;\r
+     typedef unsigned int    uint_fast32_t;\r
+# elif (USHRT_MAX == 0xffffffff)\r
+     typedef short             int32_t;\r
+     typedef short             int_least32_t;\r
+     typedef short             int_fast32_t;\r
+     typedef unsigned short    uint32_t;\r
+     typedef unsigned short    uint_least32_t;\r
+     typedef unsigned short    uint_fast32_t;\r
+# elif ULONG_MAX == 0xffffffff\r
+     typedef long            int32_t;\r
+     typedef long            int_least32_t;\r
+     typedef long            int_fast32_t;\r
+     typedef unsigned long   uint32_t;\r
+     typedef unsigned long   uint_least32_t;\r
+     typedef unsigned long   uint_fast32_t;\r
+# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) \r
+      // Integers are 64 bits on the MTA / XMT \r
+      typedef __int32           int32_t; \r
+      typedef __int32           int_least32_t; \r
+      typedef __int32           int_fast32_t; \r
+      typedef unsigned __int32  uint32_t; \r
+      typedef unsigned __int32  uint_least32_t; \r
+      typedef unsigned __int32  uint_fast32_t; \r
+# else\r
+#    error defaults not correct; you must hand modify boost/cstdint.hpp\r
+# endif\r
+\r
+//  64-bit types + intmax_t and uintmax_t  ----------------------------------//\r
+\r
+# if defined(BOOST_HAS_LONG_LONG) && \\r
+   !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \\r
+   (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \\r
+   (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))\r
+#    if defined(__hpux)\r
+     // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions\r
+#    elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL)\r
+                                                                 // 2**64 - 1\r
+#    else\r
+#       error defaults not correct; you must hand modify boost/cstdint.hpp\r
+#    endif\r
+\r
+     typedef  ::boost::long_long_type            intmax_t;\r
+     typedef  ::boost::ulong_long_type   uintmax_t;\r
+     typedef  ::boost::long_long_type            int64_t;\r
+     typedef  ::boost::long_long_type            int_least64_t;\r
+     typedef  ::boost::long_long_type            int_fast64_t;\r
+     typedef  ::boost::ulong_long_type   uint64_t;\r
+     typedef  ::boost::ulong_long_type   uint_least64_t;\r
+     typedef  ::boost::ulong_long_type   uint_fast64_t;\r
+\r
+# elif ULONG_MAX != 0xffffffff\r
+\r
+#    if ULONG_MAX == 18446744073709551615 // 2**64 - 1\r
+     typedef long                 intmax_t;\r
+     typedef unsigned long        uintmax_t;\r
+     typedef long                 int64_t;\r
+     typedef long                 int_least64_t;\r
+     typedef long                 int_fast64_t;\r
+     typedef unsigned long        uint64_t;\r
+     typedef unsigned long        uint_least64_t;\r
+     typedef unsigned long        uint_fast64_t;\r
+#    else\r
+#       error defaults not correct; you must hand modify boost/cstdint.hpp\r
+#    endif\r
+# elif defined(__GNUC__) && defined(BOOST_HAS_LONG_LONG)\r
+     __extension__ typedef long long            intmax_t;\r
+     __extension__ typedef unsigned long long   uintmax_t;\r
+     __extension__ typedef long long            int64_t;\r
+     __extension__ typedef long long            int_least64_t;\r
+     __extension__ typedef long long            int_fast64_t;\r
+     __extension__ typedef unsigned long long   uint64_t;\r
+     __extension__ typedef unsigned long long   uint_least64_t;\r
+     __extension__ typedef unsigned long long   uint_fast64_t;\r
+# elif defined(BOOST_HAS_MS_INT64)\r
+     //\r
+     // we have Borland/Intel/Microsoft __int64:\r
+     //\r
+     typedef __int64             intmax_t;\r
+     typedef unsigned __int64    uintmax_t;\r
+     typedef __int64             int64_t;\r
+     typedef __int64             int_least64_t;\r
+     typedef __int64             int_fast64_t;\r
+     typedef unsigned __int64    uint64_t;\r
+     typedef unsigned __int64    uint_least64_t;\r
+     typedef unsigned __int64    uint_fast64_t;\r
+# else // assume no 64-bit integers\r
+#  define BOOST_NO_INT64_T\r
+     typedef int32_t              intmax_t;\r
+     typedef uint32_t             uintmax_t;\r
+# endif\r
+\r
+} // namespace boost\r
+\r
+\r
+#endif // BOOST_HAS_STDINT_H\r
+\r
+#endif // BOOST_CSTDINT_HPP\r
+\r
+\r
+/****************************************************\r
+\r
+Macro definition section:\r
+\r
+Added 23rd September 2000 (John Maddock).\r
+Modified 11th September 2001 to be excluded when\r
+BOOST_HAS_STDINT_H is defined (John Maddock).\r
+Modified 11th Dec 2009 to always define the\r
+INT#_C macros if they're not already defined (John Maddock).\r
+\r
+******************************************************/\r
+\r
+#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \\r
+   (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C))\r
+//\r
+// For the following code we get several warnings along the lines of: \r
+// \r
+// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant \r
+// \r
+// So we declare this a system header to suppress these warnings. \r
+//\r
+#if defined(__GNUC__) && (__GNUC__ >= 4) \r
+#pragma GCC system_header \r
+#endif \r
+\r
+#include <limits.h>\r
+# define BOOST__STDC_CONSTANT_MACROS_DEFINED\r
+# if defined(BOOST_HAS_MS_INT64)\r
+//\r
+// Borland/Intel/Microsoft compilers have width specific suffixes:\r
+//\r
+#ifndef INT8_C\r
+#  define INT8_C(value)     value##i8\r
+#endif\r
+#ifndef INT16_C\r
+#  define INT16_C(value)    value##i16\r
+#endif\r
+#ifndef INT32_C\r
+#  define INT32_C(value)    value##i32\r
+#endif\r
+#ifndef INT64_C\r
+#  define INT64_C(value)    value##i64\r
+#endif\r
+#  ifdef __BORLANDC__\r
+    // Borland bug: appending ui8 makes the type a signed char\r
+#   define UINT8_C(value)    static_cast<unsigned char>(value##u)\r
+#  else\r
+#   define UINT8_C(value)    value##ui8\r
+#  endif\r
+#ifndef UINT16_C\r
+#  define UINT16_C(value)   value##ui16\r
+#endif\r
+#ifndef UINT32_C\r
+#  define UINT32_C(value)   value##ui32\r
+#endif\r
+#ifndef UINT64_C\r
+#  define UINT64_C(value)   value##ui64\r
+#endif\r
+#ifndef INTMAX_C\r
+#  define INTMAX_C(value)   value##i64\r
+#  define UINTMAX_C(value)  value##ui64\r
+#endif\r
+\r
+# else\r
+//  do it the old fashioned way:\r
+\r
+//  8-bit types  ------------------------------------------------------------//\r
+\r
+#  if (UCHAR_MAX == 0xff) && !defined(INT8_C)\r
+#   define INT8_C(value) static_cast<boost::int8_t>(value)\r
+#   define UINT8_C(value) static_cast<boost::uint8_t>(value##u)\r
+#  endif\r
+\r
+//  16-bit types  -----------------------------------------------------------//\r
+\r
+#  if (USHRT_MAX == 0xffff) && !defined(INT16_C)\r
+#   define INT16_C(value) static_cast<boost::int16_t>(value)\r
+#   define UINT16_C(value) static_cast<boost::uint16_t>(value##u)\r
+#  endif\r
+\r
+//  32-bit types  -----------------------------------------------------------//\r
+#ifndef INT32_C\r
+#  if (UINT_MAX == 0xffffffff)\r
+#   define INT32_C(value) value\r
+#   define UINT32_C(value) value##u\r
+#  elif ULONG_MAX == 0xffffffff\r
+#   define INT32_C(value) value##L\r
+#   define UINT32_C(value) value##uL\r
+#  endif\r
+#endif\r
+\r
+//  64-bit types + intmax_t and uintmax_t  ----------------------------------//\r
+#ifndef INT64_C\r
+#  if defined(BOOST_HAS_LONG_LONG) && \\r
+    (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX))\r
+\r
+#    if defined(__hpux)\r
+        // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions\r
+#       define INT64_C(value) value##LL\r
+#       define UINT64_C(value) value##uLL\r
+#    elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) ||  \\r
+        (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) ||  \\r
+        (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) || \\r
+        (defined(_LLONG_MAX) && _LLONG_MAX == 18446744073709551615ULL)\r
+\r
+#       define INT64_C(value) value##LL\r
+#       define UINT64_C(value) value##uLL\r
+#    else\r
+#       error defaults not correct; you must hand modify boost/cstdint.hpp\r
+#    endif\r
+#  elif ULONG_MAX != 0xffffffff\r
+\r
+#    if ULONG_MAX == 18446744073709551615U // 2**64 - 1\r
+#       define INT64_C(value) value##L\r
+#       define UINT64_C(value) value##uL\r
+#    else\r
+#       error defaults not correct; you must hand modify boost/cstdint.hpp\r
+#    endif\r
+#  elif defined(BOOST_HAS_LONG_LONG)\r
+     // Usual macros not defined, work things out for ourselves:\r
+#    if(~0uLL == 18446744073709551615ULL)\r
+#       define INT64_C(value) value##LL\r
+#       define UINT64_C(value) value##uLL\r
+#    else\r
+#       error defaults not correct; you must hand modify boost/cstdint.hpp\r
+#    endif\r
+#  else\r
+#    error defaults not correct; you must hand modify boost/cstdint.hpp\r
+#  endif\r
+\r
+#  ifdef BOOST_NO_INT64_T\r
+#   define INTMAX_C(value) INT32_C(value)\r
+#   define UINTMAX_C(value) UINT32_C(value)\r
+#  else\r
+#   define INTMAX_C(value) INT64_C(value)\r
+#   define UINTMAX_C(value) UINT64_C(value)\r
+#  endif\r
+#endif\r
+# endif // Borland/Microsoft specific width suffixes\r
+\r
+#endif // INT#_C macros.\r
+\r
+\r
+\r
+\r