From ae7bad9e9a94b1ea39e5007dc9eee32005c49128 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 7 Jul 2000 16:04:40 +0000 Subject: [PATCH 01/49] This commit was generated by cvs2svn to compensate for changes in r4, which included commits to RCS files with non-trunk default branches. [SVN r7621] --- include/boost/cstdint.hpp | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 include/boost/cstdint.hpp diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp new file mode 100644 index 00000000..3e58eeef --- /dev/null +++ b/include/boost/cstdint.hpp @@ -0,0 +1,63 @@ +// boost cstdint.hpp header file -------------------------------------------// + +// (C) Copyright boost.org 1999. Permission to copy, use, modify, sell +// and distribute this software is granted provided this copyright +// notice appears in all copies. This software is provided "as is" without +// express or implied warranty, and with no claim as to its suitability for +// any purpose. + +// See http://www.boost.org for most recent version including documentation. + +// Revision History +// 29 Jun 00 Reimplement to avoid including stdint.h within namespace boost +// 8 Aug 99 Initial version + +#ifndef BOOST_CSTDINT_HPP +#define BOOST_CSTDINT_HPP + +#include // implementation artifact; not part of interface + +#include + +namespace boost +{ + + using ::int8_t; + using ::int_least8_t; + using ::int_fast8_t; + using ::uint8_t; + using ::uint_least8_t; + using ::uint_fast8_t; + + using ::int16_t; + using ::int_least16_t; + using ::int_fast16_t; + using ::uint16_t; + using ::uint_least16_t; + using ::uint_fast16_t; + + using ::int32_t; + using ::int_least32_t; + using ::int_fast32_t; + using ::uint32_t; + using ::uint_least32_t; + using ::uint_fast32_t; + +# ifdef ULLONG_MAX + + using ::int64_t; + using ::int_least64_t; + using ::int_fast64_t; + using ::uint64_t; + using ::uint_least64_t; + using ::uint_fast64_t; + +# endif + + using ::intmax_t; + using ::uintmax_t; + +} // namespace boost + +#endif + \ No newline at end of file From 4d8c6207bac3753762a02c1c8a04d3b6b7a738c3 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 22 Sep 2000 20:39:23 +0000 Subject: [PATCH 02/49] 64-bit integer improvements from John Maddock [SVN r7776] --- include/boost/cstdint.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 3e58eeef..a790bd6f 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -9,8 +9,9 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 22 Sep 00 Better 64-bit support (John Maddock) // 29 Jun 00 Reimplement to avoid including stdint.h within namespace boost -// 8 Aug 99 Initial version +// 8 Aug 99 Initial version (Beman Dawes) #ifndef BOOST_CSTDINT_HPP #define BOOST_CSTDINT_HPP @@ -43,7 +44,7 @@ namespace boost using ::uint_least32_t; using ::uint_fast32_t; -# ifdef ULLONG_MAX +# ifdef BOOST_NO_INT64_T using ::int64_t; using ::int_least64_t; From bb2e640ae1a7bf1148b79654af040afdc0501fa4 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 23 Sep 2000 16:29:01 +0000 Subject: [PATCH 03/49] fix reversed BOOST_NO_INT64_T logic [SVN r7780] --- include/boost/cstdint.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index a790bd6f..3f8a92f9 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -44,7 +44,7 @@ namespace boost using ::uint_least32_t; using ::uint_fast32_t; -# ifdef BOOST_NO_INT64_T +#ifndef BOOST_NO_INT64_T using ::int64_t; using ::int_least64_t; @@ -53,7 +53,7 @@ namespace boost using ::uint_least64_t; using ::uint_fast64_t; -# endif +#endif using ::intmax_t; using ::uintmax_t; @@ -61,4 +61,3 @@ namespace boost } // namespace boost #endif - \ No newline at end of file From a98eefc1e177511f6e9479ee66e8990cfa4492b7 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 24 Sep 2000 11:35:25 +0000 Subject: [PATCH 04/49] addition of INTXX_C support to integer library [SVN r7792] --- include/boost/cstdint.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 3f8a92f9..f2c51316 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -9,16 +9,20 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 23 Sep 00 Added INTXX_C macro support (John Maddock). // 22 Sep 00 Better 64-bit support (John Maddock) // 29 Jun 00 Reimplement to avoid including stdint.h within namespace boost // 8 Aug 99 Initial version (Beman Dawes) +// +// this has to go before the include guard (JM): +#include + #ifndef BOOST_CSTDINT_HPP #define BOOST_CSTDINT_HPP #include // implementation artifact; not part of interface -#include namespace boost { @@ -61,3 +65,4 @@ namespace boost } // namespace boost #endif + From d33a70280600968fb636d11d327528f6a20b950d Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 12 Nov 2000 18:35:33 +0000 Subject: [PATCH 05/49] Folded stdint.h into cstdint.hpp to avoid ISO C99 incompatibilities [SVN r8174] --- include/boost/cstdint.hpp | 247 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 239 insertions(+), 8 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index f2c51316..10d2bd7d 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -1,4 +1,4 @@ -// boost cstdint.hpp header file -------------------------------------------// +// boost cstdint.hpp header file ------------------------------------------// // (C) Copyright boost.org 1999. Permission to copy, use, modify, sell // and distribute this software is granted provided this copyright @@ -9,21 +9,23 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 12 Nov 00 Merged (Jens Maurer) // 23 Sep 00 Added INTXX_C macro support (John Maddock). // 22 Sep 00 Better 64-bit support (John Maddock) // 29 Jun 00 Reimplement to avoid including stdint.h within namespace boost // 8 Aug 99 Initial version (Beman Dawes) -// -// this has to go before the include guard (JM): -#include #ifndef BOOST_CSTDINT_HPP #define BOOST_CSTDINT_HPP -#include // implementation artifact; not part of interface +#include +#ifdef BOOST_SYSTEM_HAS_STDINT_H + +# include // implementation artifact; not part of interface + namespace boost { @@ -48,7 +50,7 @@ namespace boost using ::uint_least32_t; using ::uint_fast32_t; -#ifndef BOOST_NO_INT64_T +# ifndef BOOST_NO_INT64_T using ::int64_t; using ::int_least64_t; @@ -57,12 +59,241 @@ namespace boost using ::uint_least64_t; using ::uint_fast64_t; -#endif +# endif using ::intmax_t; using ::uintmax_t; } // namespace boost -#endif +#else // BOOST_SYSTEM_HAS_STDINT_H + + +# include // implementation artifact; not part of interface + + +namespace boost +{ + +// These are fairly safe guesses for some 16-bit, and most 32-bit and 64-bit +// platforms. For other systems, they will have to be hand tailored. +// +// Because the fast types are assumed to be the same as the undecorated types, +// it may be possible to hand tailor a more efficient implementation. Such +// an optimization may be illusionary; on the Intel x86-family 386 on, for +// example, byte arithmetic and load/stores are as fast as "int" sized ones. + +// 8-bit types ------------------------------------------------------------// + +# if UCHAR_MAX == 0xff + typedef signed char int8_t; + typedef signed char int_least8_t; + typedef signed char int_fast8_t; + typedef unsigned char uint8_t; + typedef unsigned char uint_least8_t; + typedef unsigned char uint_fast8_t; +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif + +// 16-bit types -----------------------------------------------------------// + +# if USHRT_MAX == 0xffff + typedef short int16_t; + typedef short int_least16_t; + typedef short int_fast16_t; + typedef unsigned short uint16_t; + typedef unsigned short uint_least16_t; + typedef unsigned short uint_fast16_t; +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif + +// 32-bit types -----------------------------------------------------------// + +# if UINT_MAX == 0xffffffff + typedef int int32_t; + typedef int int_least32_t; + typedef int int_fast32_t; + typedef unsigned int uint32_t; + typedef unsigned int uint_least32_t; + typedef unsigned int uint_fast32_t; +# elif ULONG_MAX == 0xffffffff + typedef long int32_t; + typedef long int_least32_t; + typedef long int_fast32_t; + typedef unsigned long uint32_t; + typedef unsigned long uint_least32_t; + typedef unsigned long uint_fast32_t; +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif + +// 64-bit types + intmax_t and uintmax_t ----------------------------------// + +# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) && !(defined(_WIN32) && defined(__GNUC__)) +# if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615) || \ + (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615) + // 2**64 - 1 + typedef long long intmax_t; + typedef unsigned long long uintmax_t; + typedef long long int64_t; + typedef long long int_least64_t; + typedef long long int_fast64_t; + typedef unsigned long long uint64_t; + typedef unsigned long long uint_least64_t; + typedef unsigned long long uint_fast64_t; +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# elif ULONG_MAX != 0xffffffff + +# if ULONG_MAX == 18446744073709551615 // 2**64 - 1 + typedef long intmax_t; + typedef unsigned long uintmax_t; + typedef long int64_t; + typedef long int_least64_t; + typedef long int_fast64_t; + typedef unsigned long uint64_t; + typedef unsigned long uint_least64_t; + typedef unsigned long uint_fast64_t; +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# elif (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)) + // + // we have Borland/Microsoft __int64: + // + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; + typedef __int64 int64_t; + typedef __int64 int_least64_t; + typedef __int64 int_fast64_t; + typedef unsigned __int64 uint64_t; + typedef unsigned __int64 uint_least64_t; + typedef unsigned __int64 uint_fast64_t; +# else // assume no 64-bit integers +# define BOOST_NO_INT64_T + typedef int32_t intmax_t; + typedef uint32_t uintmax_t; +# endif + +} // namespace boost + + +#endif // BOOST_SYSTEM_HAS_STDINT_H + +#endif // BOOST_CSTDINT_HPP + + +/**************************************************** + +Macro definition section: + +Define various INTXX_C macros only if +__STDC_CONSTANT_MACROS is defined. + +Undefine the macros if __STDC_CONSTANT_MACROS is +not defined and the macros are (cf ). + +Added 23rd September (John Maddock). + +******************************************************/ + +#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) +# define BOOST__STDC_CONSTANT_MACROS_DEFINED +# if (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)) +// +// Borland/Microsoft compilers have width specific suffixes: +// +# define INT8_C(value) value##i8 +# define INT16_C(value) value##i16 +# define INT32_C(value) value##i32 +# define INT64_C(value) value##i64 +# ifdef __BORLANDC__ + // Borland bug: appending ui8 makes the type a signed char +# define UINT8_C(value) static_cast(value##u) +# else +# define UINT8_C(value) value##ui8 +# endif +# define UINT16_C(value) value##ui16 +# define UINT32_C(value) value##ui32 +# define UINT64_C(value) value##ui64 +# define INTMAX_C(value) value##i64 +# define UINTMAX_C(value) value##ui64 + +# else +// do it the old fashioned way: + +// 8-bit types ------------------------------------------------------------// + +# if UCHAR_MAX == 0xff +# define INT8_C(value) static_cast(value) +# define UINT8_C(value) static_cast(value##u) +# endif + +// 16-bit types -----------------------------------------------------------// + +# if USHRT_MAX == 0xffff +# define INT16_C(value) static_cast(value) +# define UINT16_C(value) static_cast(value##u) +# endif + +// 32-bit types -----------------------------------------------------------// + +# if UINT_MAX == 0xffffffff +# define INT32_C(value) value +# define UINT32_C(value) value##u +# elif ULONG_MAX == 0xffffffff +# define INT32_C(value) value##L +# define UINT32_C(value) value##uL +# endif + +// 64-bit types + intmax_t and uintmax_t ----------------------------------// + +# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) && !(defined(_WIN32) && defined(__GNUC__)) +# if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615) || \ + (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615) +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# elif ULONG_MAX != 0xffffffff + +# if ULONG_MAX == 18446744073709551615 // 2**64 - 1 +# define INT64_C(value) value##L +# define UINT64_C(value) value##uL +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# endif + +# ifdef BOOST_NO_INT64_T +# define INTMAX_C(value) INT32_C(value) +# define UINTMAX_C(value) UINT32_C(value) +# else +# define INTMAX_C(value) INT64_C(value) +# define UINTMAX_C(value) UINT64_C(value) +# endif + +# endif // Borland/Microsoft specific width suffixes + + +#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) +// +// undef all the macros: +// +# undef INT8_C +# undef INT16_C +# undef INT32_C +# undef INT64_C +# undef UINT8_C +# undef UINT16_C +# undef UINT32_C +# undef UINT64_C +# undef INTMAX_C +# undef UINTMAX_C + +#endif // __STDC_CONSTANT_MACROS_DEFINED etc. From 07dfe3f70d500bb6d4c78977385f21a234d7fa10 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 18 Jan 2001 22:44:28 +0000 Subject: [PATCH 06/49] restricted Windows/gcc exclusion of int64_t to Cygwin, because MingW seems to work [SVN r8641] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 10d2bd7d..212f1cea 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -252,7 +252,7 @@ Added 23rd September (John Maddock). // 64-bit types + intmax_t and uintmax_t ----------------------------------// -# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) && !(defined(_WIN32) && defined(__GNUC__)) +# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) && !(defined(__CYGWIN__) || defined(__CYGWIN32__)) # if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615) || \ (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615) # define INT64_C(value) value##LL From f9e8a68af2497564313f4a72d4a9deb452704326 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 22 Jan 2001 05:06:37 +0000 Subject: [PATCH 07/49] Fixes so that long long is recognized for GCC. [SVN r8706] --- include/boost/cstdint.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 212f1cea..6da178f3 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -132,9 +132,9 @@ namespace boost // 64-bit types + intmax_t and uintmax_t ----------------------------------// -# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) && !(defined(_WIN32) && defined(__GNUC__)) -# if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615) || \ - (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615) +# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) +# if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ + (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) // 2**64 - 1 typedef long long intmax_t; typedef unsigned long long uintmax_t; From fabcdfc385fb22b2636b245fb763a6cf5725add6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 23 Jan 2001 19:45:00 +0000 Subject: [PATCH 08/49] for int32_t and intmax_t, prefer "long" over "int" if both are 32bit [SVN r8743] --- include/boost/cstdint.hpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 6da178f3..38f61fef 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -9,6 +9,7 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 23 Jan 01 prefer "long" over "int" for int32_t and intmax_t (Jens Maurer) // 12 Nov 00 Merged (Jens Maurer) // 23 Sep 00 Added INTXX_C macro support (John Maddock). // 22 Sep 00 Better 64-bit support (John Maddock) @@ -112,20 +113,20 @@ namespace boost // 32-bit types -----------------------------------------------------------// -# if UINT_MAX == 0xffffffff - typedef int int32_t; - typedef int int_least32_t; - typedef int int_fast32_t; - typedef unsigned int uint32_t; - typedef unsigned int uint_least32_t; - typedef unsigned int uint_fast32_t; -# elif ULONG_MAX == 0xffffffff +# if ULONG_MAX == 0xffffffff typedef long int32_t; typedef long int_least32_t; typedef long int_fast32_t; typedef unsigned long uint32_t; typedef unsigned long uint_least32_t; typedef unsigned long uint_fast32_t; +# elif UINT_MAX == 0xffffffff + typedef int int32_t; + typedef int int_least32_t; + typedef int int_fast32_t; + typedef unsigned int uint32_t; + typedef unsigned int uint_least32_t; + typedef unsigned int uint_fast32_t; # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif From 8dea5a2fcf61e36078a60919508f43fd80ae87bf Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 24 Jan 2001 12:18:30 +0000 Subject: [PATCH 09/49] cstdint: cygwin fixes for long long support [SVN r8754] --- include/boost/cstdint.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 38f61fef..31b917d8 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -253,7 +253,7 @@ Added 23rd September (John Maddock). // 64-bit types + intmax_t and uintmax_t ----------------------------------// -# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) && !(defined(__CYGWIN__) || defined(__CYGWIN32__)) +# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) # if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615) || \ (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615) # define INT64_C(value) value##LL @@ -298,3 +298,4 @@ Added 23rd September (John Maddock). # undef UINTMAX_C #endif // __STDC_CONSTANT_MACROS_DEFINED etc. + From c77099ac7bf8d1561d2f7d07dd81245db1777d75 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Sun, 11 Feb 2001 01:21:56 +0000 Subject: [PATCH 10/49] removed backslashes in macros [SVN r9097] --- include/boost/cstdint.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 31b917d8..0f43f2cf 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -134,8 +134,7 @@ namespace boost // 64-bit types + intmax_t and uintmax_t ----------------------------------// # if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) -# if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ - (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) +# if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) // 2**64 - 1 typedef long long intmax_t; typedef unsigned long long uintmax_t; From 5867dcf011f4ef300201706fb23a93b851bafd75 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 16 Apr 2001 12:53:03 +0000 Subject: [PATCH 11/49] check for ULONGLONG_MAX as well [SVN r9793] --- include/boost/cstdint.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 0f43f2cf..d4537a88 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -9,6 +9,7 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 16 Apr 01 check LONGLONG_MAX when looking for "long long" (Jens Maurer) // 23 Jan 01 prefer "long" over "int" for int32_t and intmax_t (Jens Maurer) // 12 Nov 00 Merged (Jens Maurer) // 23 Sep 00 Added INTXX_C macro support (John Maddock). @@ -133,8 +134,8 @@ namespace boost // 64-bit types + intmax_t and uintmax_t ----------------------------------// -# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) -# if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) +# if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) +# if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) // 2**64 - 1 typedef long long intmax_t; typedef unsigned long long uintmax_t; @@ -252,9 +253,9 @@ Added 23rd September (John Maddock). // 64-bit types + intmax_t and uintmax_t ----------------------------------// -# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX)) -# if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615) || \ - (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615) +# if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) +# if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ + (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) # define INT64_C(value) value##LL # define UINT64_C(value) value##uLL # else From 3c532ab1cdec7b30ee8c6453280a3a59f0c60371 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 7 May 2001 21:21:13 +0000 Subject: [PATCH 12/49] add HP-UX workaround [SVN r10051] --- include/boost/cstdint.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index d4537a88..4077da7f 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -26,7 +26,13 @@ #ifdef BOOST_SYSTEM_HAS_STDINT_H -# include // implementation artifact; not part of interface +// The following #include is an implementation artifact; not part of interface. +# ifdef __hpux +// HP-UX has a nice in a non-standard location +# include +# else +# include +# endif namespace boost { From 59eda005d1cb368dc4d520eaf881c1fe7b2c92c6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 8 May 2001 18:14:14 +0000 Subject: [PATCH 13/49] int64_t may not be defined on HP-UX when using gcc [SVN r10067] --- include/boost/cstdint.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 4077da7f..82533e00 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -30,6 +30,10 @@ # ifdef __hpux // HP-UX has a nice in a non-standard location # include +# ifdef __STDC_32_MODE__ + // this is triggered with GCC, because it defines __cplusplus < 199707L +# define BOOST_NO_INT64_T +# endif # else # include # endif From a431ef5b54c87441afe86eaea03e90b6050a5e98 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 9 May 2001 21:07:20 +0000 Subject: [PATCH 14/49] HP-UX needs special attention because ULONG_LONG_MAX is not fully usable [SVN r10080] --- include/boost/cstdint.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 82533e00..9db0eb16 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -264,8 +264,10 @@ Added 23rd September (John Maddock). // 64-bit types + intmax_t and uintmax_t ----------------------------------// # if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) + // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions # if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ - (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) + (defined(ULONG_LONG_MAX) && (defined(__hpux) || ULONG_LONG_MAX == 18446744073709551615U)) || \ + (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) # define INT64_C(value) value##LL # define UINT64_C(value) value##uLL # else From 7a0711230b4d2a295d08c41056a2fb7d3cba9c9d Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 11 May 2001 10:47:57 +0000 Subject: [PATCH 15/49] Preprocessor fix for VC6 + STLPort 4.1b6 [SVN r10087] --- include/boost/cstdint.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 9db0eb16..68daea55 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -144,7 +144,7 @@ namespace boost // 64-bit types + intmax_t and uintmax_t ----------------------------------// -# if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) +# if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || (defined(ULONGLONG_MAX) && !defined(BOOST_MSVC) && !defined(__BORLANDC__)) # if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) // 2**64 - 1 typedef long long intmax_t; @@ -311,3 +311,4 @@ Added 23rd September (John Maddock). #endif // __STDC_CONSTANT_MACROS_DEFINED etc. + From de5d29fa8e0a668f708ed79d0545ff6a8d0f2e78 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 11 May 2001 17:04:56 +0000 Subject: [PATCH 16/49] Don't use "long long" with gcc 3.0's shipped library, because it does not define operator<<(ostream&, long long) overloads. [SVN r10095] --- include/boost/cstdint.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 68daea55..48c782f7 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -144,7 +144,12 @@ namespace boost // 64-bit types + intmax_t and uintmax_t ----------------------------------// -# if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || (defined(ULONGLONG_MAX) && !defined(BOOST_MSVC) && !defined(__BORLANDC__)) +// GCC 3.0 supports "long long" and has the proper defines. However, the +// library shipped with GCC 3.0 doesn't have operator<<(ostream&, long long). +// For now, disable "long long" here. +# if !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \ + !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 0 && defined(__GLIBCPP__)) && \ + (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) # if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) // 2**64 - 1 typedef long long intmax_t; From 0722b9013706a5b76c5e79e36e2ff2f9fe1b276d Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 13 May 2001 18:17:15 +0000 Subject: [PATCH 17/49] fix the "gcc 3.0 and long long" fix to check for the appropriate symbol [SVN r10107] --- include/boost/cstdint.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 48c782f7..f8ce8cd5 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -144,11 +144,8 @@ namespace boost // 64-bit types + intmax_t and uintmax_t ----------------------------------// -// GCC 3.0 supports "long long" and has the proper defines. However, the -// library shipped with GCC 3.0 doesn't have operator<<(ostream&, long long). -// For now, disable "long long" here. # if !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \ - !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 0 && defined(__GLIBCPP__)) && \ + (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) # if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) // 2**64 - 1 From 67694454c017067a3930655195a746c10ebc801d Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 13 Aug 2001 17:02:48 +0000 Subject: [PATCH 18/49] Add LL suffix to line 150 for long longs at suggestion of Toon Knapen [SVN r10854] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index f8ce8cd5..8e2aaa3d 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -147,7 +147,7 @@ namespace boost # if !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \ (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) -# if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) +# if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) // 2**64 - 1 typedef long long intmax_t; typedef unsigned long long uintmax_t; From dbd1afb2ef6a4cb6198cb26723a9440d168cea49 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 18 Sep 2001 11:13:39 +0000 Subject: [PATCH 19/49] commit of split-config, including any changes required to existing libraries (mainly regex). [SVN r11138] --- include/boost/cstdint.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 8e2aaa3d..2fdc9c9e 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -24,7 +24,7 @@ #include -#ifdef BOOST_SYSTEM_HAS_STDINT_H +#ifdef BOOST_HAS_STDINT_H // The following #include is an implementation artifact; not part of interface. # ifdef __hpux @@ -79,7 +79,7 @@ namespace boost } // namespace boost -#else // BOOST_SYSTEM_HAS_STDINT_H +#else // BOOST_HAS_STDINT_H # include // implementation artifact; not part of interface @@ -195,7 +195,7 @@ namespace boost } // namespace boost -#endif // BOOST_SYSTEM_HAS_STDINT_H +#endif // BOOST_HAS_STDINT_H #endif // BOOST_CSTDINT_HPP @@ -210,11 +210,13 @@ __STDC_CONSTANT_MACROS is defined. Undefine the macros if __STDC_CONSTANT_MACROS is not defined and the macros are (cf ). -Added 23rd September (John Maddock). +Added 23rd September 2000 (John Maddock). +Modified 11th September 2001 to be excluded when +BOOST_HAS_STDINT_H is defined (John Maddock). ******************************************************/ -#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) +#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H) # define BOOST__STDC_CONSTANT_MACROS_DEFINED # if (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)) // @@ -296,7 +298,7 @@ Added 23rd September (John Maddock). # endif // Borland/Microsoft specific width suffixes -#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) +#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) && !defined(BOOST_HAS_STDINT_H) // // undef all the macros: // From 1b1273d98ca9eb31e979f25fcf3e9238c9327941 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 20 Sep 2001 19:25:35 +0000 Subject: [PATCH 20/49] port cstdint.hpp to HP-UX [SVN r11175] --- include/boost/cstdint.hpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 2fdc9c9e..619f78b7 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -28,8 +28,8 @@ // The following #include is an implementation artifact; not part of interface. # ifdef __hpux -// HP-UX has a nice in a non-standard location -# include +// HP-UX has a vaguely nice in a non-standard location +# include # ifdef __STDC_32_MODE__ // this is triggered with GCC, because it defines __cplusplus < 199707L # define BOOST_NO_INT64_T @@ -147,8 +147,14 @@ namespace boost # if !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \ (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) -# if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) +# if defined(__hpux) + // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions +# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) // 2**64 - 1 +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif + typedef long long intmax_t; typedef unsigned long long uintmax_t; typedef long long int64_t; @@ -157,9 +163,7 @@ namespace boost typedef unsigned long long uint64_t; typedef unsigned long long uint_least64_t; typedef unsigned long long uint_fast64_t; -# else -# error defaults not correct; you must hand modify boost/cstdint.hpp -# endif + # elif ULONG_MAX != 0xffffffff # if ULONG_MAX == 18446744073709551615 // 2**64 - 1 @@ -268,15 +272,17 @@ BOOST_HAS_STDINT_H is defined (John Maddock). // 64-bit types + intmax_t and uintmax_t ----------------------------------// # if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) +# if defined(__hpux) // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions -# if (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ - (defined(ULONG_LONG_MAX) && (defined(__hpux) || ULONG_LONG_MAX == 18446744073709551615U)) || \ +# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ + (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || \ (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) -# define INT64_C(value) value##LL -# define UINT64_C(value) value##uLL + # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL # elif ULONG_MAX != 0xffffffff # if ULONG_MAX == 18446744073709551615 // 2**64 - 1 From f136c7a620aae94bdd8ba519defdfd57445191a1 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 31 Oct 2001 19:35:59 +0000 Subject: [PATCH 21/49] use BOOST_HAS_LONG_LONG [SVN r11493] --- include/boost/cstdint.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 619f78b7..715acc96 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -8,7 +8,8 @@ // See http://www.boost.org for most recent version including documentation. -// Revision History +// Revision Historyä +// 31 Oct 01 use BOOST_HAS_LONG_LONG to check for "long long" (Jens M.) // 16 Apr 01 check LONGLONG_MAX when looking for "long long" (Jens Maurer) // 23 Jan 01 prefer "long" over "int" for int32_t and intmax_t (Jens Maurer) // 12 Nov 00 Merged (Jens Maurer) @@ -144,8 +145,8 @@ namespace boost // 64-bit types + intmax_t and uintmax_t ----------------------------------// -# if !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \ - (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \ +# if defined(BOOST_HAS_LONG_LONG) && \ + !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) # if defined(__hpux) // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions @@ -271,7 +272,9 @@ BOOST_HAS_STDINT_H is defined (John Maddock). // 64-bit types + intmax_t and uintmax_t ----------------------------------// -# if defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) +# if defined(BOOST_HAS_LONG_LONG) && \ + (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) + # if defined(__hpux) // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions # elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ From 0c9ae76f94531f38ed7cd5ea124b2eb4ec76e7b1 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 1 Nov 2001 21:52:08 +0000 Subject: [PATCH 22/49] only use "long long" if there's a stdlib overload [SVN r11516] --- include/boost/cstdint.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 715acc96..477ea841 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -147,6 +147,7 @@ namespace boost # if defined(BOOST_HAS_LONG_LONG) && \ !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \ + (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) # if defined(__hpux) // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions From e0350ea5a913c2846bb6d8be016a20c797717e9c Mon Sep 17 00:00:00 2001 From: Darin Adler Date: Sun, 4 Nov 2001 21:53:21 +0000 Subject: [PATCH 23/49] Remove non-ASCII character that crept in. [SVN r11570] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 477ea841..7b89deac 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -8,7 +8,7 @@ // See http://www.boost.org for most recent version including documentation. -// Revision Historyä +// Revision History // 31 Oct 01 use BOOST_HAS_LONG_LONG to check for "long long" (Jens M.) // 16 Apr 01 check LONGLONG_MAX when looking for "long long" (Jens Maurer) // 23 Jan 01 prefer "long" over "int" for int32_t and intmax_t (Jens Maurer) From 24ea68b00e926c34d18728103dc01d59867efc14 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 31 Jan 2002 12:58:35 +0000 Subject: [PATCH 24/49] cstdint.hpp: - Handle FreeBSD's [SVN r12601] --- include/boost/cstdint.hpp | 50 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 7b89deac..06959a97 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -35,6 +35,8 @@ // this is triggered with GCC, because it defines __cplusplus < 199707L # define BOOST_NO_INT64_T # endif +# elif defined(__FreeBSD__) +# include # else # include # endif @@ -79,10 +81,56 @@ namespace boost } // namespace boost +#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) +// FreeBSD has an that contains much of what we need +# include + +namespace boost { + + using ::int8_t; + typedef int8_t int_least8_t; + typedef int8_t int_fast8_t; + using ::uint8_t; + typedef uint8_t uint_least8_t; + typedef uint8_t uint_fast8_t; + + using ::int16_t; + typedef int16_t int_least16_t; + typedef int16_t int_fast16_t; + using ::uint16_t; + typedef uint16_t uint_least16_t; + typedef uint16_t uint_fast16_t; + + using ::int32_t; + typedef int32_t int_least32_t; + typedef int32_t int_fast32_t; + using ::uint32_t; + typedef uint32_t uint_least32_t; + typedef uint32_t uint_fast32_t; + +# ifndef BOOST_NO_INT64_T + + using ::int64_t; + typedef int64_t int_least64_t; + typedef int64_t int_fast64_t; + using ::uint64_t; + typedef uint64_t uint_least64_t; + typedef uint64_t uint_fast64_t; + + typedef int64_t intmax_t; + typedef uint64_t uintmax_t; + +# else + + typedef int32_t intmax_t; + typedef uint32_t uintmax_t; + +# endif + +} // namespace boost #else // BOOST_HAS_STDINT_H - # include // implementation artifact; not part of interface From 345c1272276a7c3759c8719b4b0057d4742b4ac2 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 4 Aug 2002 01:27:24 +0000 Subject: [PATCH 25/49] Check for BOOST_HAS_MS_INT64 instead of specific compilers [SVN r14664] --- include/boost/cstdint.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 06959a97..7e91dd82 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -228,9 +228,9 @@ namespace boost # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif -# elif (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)) +# elif defined(BOOST_HAS_MS_INT64) // - // we have Borland/Microsoft __int64: + // we have Borland/Intel/Microsoft __int64: // typedef __int64 intmax_t; typedef unsigned __int64 uintmax_t; From 5bfc97ec8d2c17ccd725d4dd08568c7d7a9ae6fc Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 5 Aug 2002 00:02:10 +0000 Subject: [PATCH 26/49] BOOST_HAS_MS_INT64 rather than specific compilers [SVN r14668] --- include/boost/cstdint.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 7e91dd82..20678c50 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -272,9 +272,9 @@ BOOST_HAS_STDINT_H is defined (John Maddock). #if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H) # define BOOST__STDC_CONSTANT_MACROS_DEFINED -# if (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)) +# if defined(BOOST_HAS_MS_INT64) // -// Borland/Microsoft compilers have width specific suffixes: +// Borland/Intel/Microsoft compilers have width specific suffixes: // # define INT8_C(value) value##i8 # define INT16_C(value) value##i16 From 0e7f67a96df0697c92fe4c47ae0ba4d2954a002f Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 21 Oct 2002 11:00:50 +0000 Subject: [PATCH 27/49] Merged changes from RC_1_29_0 branch [SVN r15958] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 20678c50..6f65b903 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -35,7 +35,7 @@ // this is triggered with GCC, because it defines __cplusplus < 199707L # define BOOST_NO_INT64_T # endif -# elif defined(__FreeBSD__) +# elif defined(__FreeBSD__) || defined(__IBMCPP__) # include # else # include From 66e398892178425f74a482c47aab225926dd84d5 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 27 Dec 2002 16:51:53 +0000 Subject: [PATCH 28/49] add or update See www.boost.org comments [SVN r16708] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 6f65b903..5cc8589d 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -6,7 +6,7 @@ // express or implied warranty, and with no claim as to its suitability for // any purpose. -// See http://www.boost.org for most recent version including documentation. +// See http://www.boost.org/libs/integer for documentation. // Revision History // 31 Oct 01 use BOOST_HAS_LONG_LONG to check for "long long" (Jens M.) From 6204b62acdcc5a7b7aca8faad541417eebc67359 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 22 Jan 2003 12:12:14 +0000 Subject: [PATCH 29/49] Added Cray support [SVN r16989] --- include/boost/cstdint.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 5cc8589d..26ab4688 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -167,6 +167,12 @@ namespace boost typedef unsigned short uint16_t; typedef unsigned short uint_least16_t; typedef unsigned short uint_fast16_t; +# elif (USHRT_MAX == 0xffffffff) && defined(CRAY) + // no 16-bit types on Cray: + typedef short int_least16_t; + typedef short int_fast16_t; + typedef unsigned short uint_least16_t; + typedef unsigned short uint_fast16_t; # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif @@ -374,3 +380,4 @@ BOOST_HAS_STDINT_H is defined (John Maddock). #endif // __STDC_CONSTANT_MACROS_DEFINED etc. + From f17865638139d928f7eac48fef6b02cb385ff450 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 24 Jan 2003 11:57:27 +0000 Subject: [PATCH 30/49] Added Cray X1 support [SVN r17022] --- include/boost/cstdint.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 26ab4688..69235cd3 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -161,12 +161,23 @@ namespace boost // 16-bit types -----------------------------------------------------------// # if USHRT_MAX == 0xffff +# if defined(__crayx1) + // The Cray X1 has a 16-bit short, however it is not recommend + // for use in performance critical code. + typedef short int16_t; + typedef short int_least16_t; + typedef int int_fast16_t; + typedef unsigned short uint16_t; + typedef unsigned short uint_least16_t; + typedef unsigned int uint_fast16_t; +# else typedef short int16_t; typedef short int_least16_t; typedef short int_fast16_t; typedef unsigned short uint16_t; typedef unsigned short uint_least16_t; typedef unsigned short uint_fast16_t; +# endif # elif (USHRT_MAX == 0xffffffff) && defined(CRAY) // no 16-bit types on Cray: typedef short int_least16_t; @@ -381,3 +392,4 @@ BOOST_HAS_STDINT_H is defined (John Maddock). + From efdf53a42c1ae76b7f496e1e0031eccb240a3c65 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 22 May 2003 18:09:32 +0000 Subject: [PATCH 31/49] include instead of , fixing a date-time issue on Comeau [SVN r18499] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 69235cd3..e8c2f5c5 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -131,7 +131,7 @@ namespace boost { #else // BOOST_HAS_STDINT_H -# include // implementation artifact; not part of interface +# include // implementation artifact; not part of interface namespace boost From a8616a783bad44e5ac8dfa971621a6343f974a8f Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 14 Jan 2004 13:30:49 +0000 Subject: [PATCH 32/49] Patches for cstdint support: cygwin and mingw now use native stdint headers. default header now compiles in -pedantic -ansi mode with gcc. [SVN r21728] --- include/boost/cstdint.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index e8c2f5c5..5dc83b4a 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -245,6 +245,15 @@ namespace boost # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif +# elif defined(__GNUC__) && defined(BOOST_HAS_LONG_LONG) + __extension__ typedef long long intmax_t; + __extension__ typedef unsigned long long uintmax_t; + __extension__ typedef long long int64_t; + __extension__ typedef long long int_least64_t; + __extension__ typedef long long int_fast64_t; + __extension__ typedef unsigned long long uint64_t; + __extension__ typedef unsigned long long uint_least64_t; + __extension__ typedef unsigned long long uint_fast64_t; # elif defined(BOOST_HAS_MS_INT64) // // we have Borland/Intel/Microsoft __int64: From 920a41ee5440cbed12c21017800079562a6d26c3 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 10 Aug 2004 12:53:34 +0000 Subject: [PATCH 33/49] Removed Boost.org copyrights and replaced with originating authors copyright instead. [SVN r24372] --- include/boost/cstdint.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 5dc83b4a..d51ef8a7 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -1,10 +1,11 @@ // boost cstdint.hpp header file ------------------------------------------// -// (C) Copyright boost.org 1999. Permission to copy, use, modify, sell -// and distribute this software is granted provided this copyright -// notice appears in all copies. This software is provided "as is" without -// express or implied warranty, and with no claim as to its suitability for -// any purpose. +// (C) Copyright Beman Dawes 1999. +// (C) Copyright Jens Mauer 2001 +// (C) Copyright John Maddock 2001 +// Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/integer for documentation. From 0b75c06eee80ed346d4b20d665240200f4313fb4 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 4 Sep 2004 10:34:49 +0000 Subject: [PATCH 34/49] Added new types boost::long_long_type and boost::ulong_long_type in boost/config.hpp and applied these types in place of "long long" throughout. As a result, almost all of boost now compiles cleanly with -ansi -pedantic with gcc. Changes tested with gcc 3.3, 2.95, VC7.1 and Intel 8. [SVN r24899] --- include/boost/cstdint.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index d51ef8a7..975d3ffd 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -223,14 +223,14 @@ namespace boost # error defaults not correct; you must hand modify boost/cstdint.hpp # endif - typedef long long intmax_t; - typedef unsigned long long uintmax_t; - typedef long long int64_t; - typedef long long int_least64_t; - typedef long long int_fast64_t; - typedef unsigned long long uint64_t; - typedef unsigned long long uint_least64_t; - typedef unsigned long long uint_fast64_t; + typedef ::boost::long_long_type intmax_t; + typedef ::boost::ulong_long_type uintmax_t; + typedef ::boost::long_long_type int64_t; + typedef ::boost::long_long_type int_least64_t; + typedef ::boost::long_long_type int_fast64_t; + typedef ::boost::ulong_long_type uint64_t; + typedef ::boost::ulong_long_type uint_least64_t; + typedef ::boost::ulong_long_type uint_fast64_t; # elif ULONG_MAX != 0xffffffff From 2f3debf876bb8170b4110a2968f2d027092c7a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Sch=C3=B6pflin?= Date: Tue, 12 Oct 2004 16:42:58 +0000 Subject: [PATCH 35/49] Better support for Tru64. [SVN r25689] --- include/boost/cstdint.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 975d3ffd..40ad8443 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -82,8 +82,8 @@ namespace boost } // namespace boost -#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) -// FreeBSD has an that contains much of what we need +#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) +// FreeBSD and Tru64 have an that contains much of what we need. # include namespace boost { From 5eb02cba79d38bd64faf0142988d194219305bfb Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 30 May 2005 01:45:13 +0000 Subject: [PATCH 36/49] Replace buggy Cygwin INTMAX_C and UINTMAX_C macros [SVN r29276] --- include/boost/cstdint.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 40ad8443..afdf5adb 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -40,6 +40,15 @@ # include # else # include + +// There is a bug in Cygwin two _C macros +# if defined(__STDC_CONSTANT_MACROS) && defined(__CYGWIN__) +# undef INTMAX_C +# undef UINTMAX_C +# define INTMAX_C(c) c##LL +# define UINTMAX_C(c) c##ULL +# endif + # endif namespace boost From a8b414ef67c80416d5a2f777a0ff9a47b563bbdb Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 19 Nov 2005 19:38:13 +0000 Subject: [PATCH 37/49] Merge from RC_1_33_0. [SVN r31703] --- include/boost/cstdint.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index afdf5adb..698c149f 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -51,6 +51,37 @@ # endif +#ifdef __QNX__ + +// QNX (Dinkumware stdlib) defines these as non-standard names. +// Reflect to the standard names. + +typedef ::intleast8_t int_least8_t; +typedef ::intfast8_t int_fast8_t; +typedef ::uintleast8_t uint_least8_t; +typedef ::uintfast8_t uint_fast8_t; + +typedef ::intleast16_t int_least16_t; +typedef ::intfast16_t int_fast16_t; +typedef ::uintleast16_t uint_least16_t; +typedef ::uintfast16_t uint_fast16_t; + +typedef ::intleast32_t int_least32_t; +typedef ::intfast32_t int_fast32_t; +typedef ::uintleast32_t uint_least32_t; +typedef ::uintfast32_t uint_fast32_t; + +# ifndef BOOST_NO_INT64_T + +typedef ::intleast64_t int_least64_t; +typedef ::intfast64_t int_fast64_t; +typedef ::uintleast64_t uint_least64_t; +typedef ::uintfast64_t uint_fast64_t; + +# endif + +#endif + namespace boost { From 628cb70df73432897fef24dd73b5022f994024b5 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 24 Jan 2006 17:23:54 +0000 Subject: [PATCH 38/49] Apparently we forgot to include [SVN r32397] --- include/boost/cstdint.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 698c149f..31a432a8 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -173,6 +173,7 @@ namespace boost { #else // BOOST_HAS_STDINT_H # include // implementation artifact; not part of interface +# include // needed for limits macros namespace boost From e68c78a3c465ca58749e8acee0e4dbc7ab7c2e27 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 14 Jan 2009 10:17:25 +0000 Subject: [PATCH 39/49] Fixes #2654. [SVN r50572] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 31a432a8..d55a4840 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -36,7 +36,7 @@ // this is triggered with GCC, because it defines __cplusplus < 199707L # define BOOST_NO_INT64_T # endif -# elif defined(__FreeBSD__) || defined(__IBMCPP__) +# elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX) # include # else # include From e50fa7d4eeb5043b934ac64eefcf6871aa5eb2d2 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 22 Nov 2009 17:12:57 +0000 Subject: [PATCH 40/49] Fixes #3180. [SVN r57845] --- include/boost/cstdint.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index d55a4840..fbce18de 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -220,6 +220,15 @@ namespace boost typedef unsigned short uint_least16_t; typedef unsigned short uint_fast16_t; # endif +# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) + // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified + // MTA / XMT does support the following non-standard integer types + typedef __short16 int16_t; + typedef __short16 int_least16_t; + typedef __short16 int_fast16_t; + typedef unsigned __short16 uint16_t; + typedef unsigned __short16 uint_least16_t; + typedef unsigned __short16 uint_fast16_t; # elif (USHRT_MAX == 0xffffffff) && defined(CRAY) // no 16-bit types on Cray: typedef short int_least16_t; @@ -246,6 +255,14 @@ namespace boost typedef unsigned int uint32_t; typedef unsigned int uint_least32_t; typedef unsigned int uint_fast32_t; +# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) + // Integers are 64 bits on the MTA / XMT + typedef __int32 int32_t; + typedef __int32 int_least32_t; + typedef __int32 int_fast32_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int32 uint_fast32_t; # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif From d6ada0eb0cf1ea37a9f9bff2c8b7748697845281 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 23 Nov 2009 09:51:23 +0000 Subject: [PATCH 41/49] Fix for Comeau compiler - does not define __GLIBC_HAVE_LONG_LONG which in turn causes GLIBC's stdint.h to misbehave. Fixes #3548. [SVN r57858] --- include/boost/cstdint.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index fbce18de..030995f9 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -25,8 +25,13 @@ #include - -#ifdef BOOST_HAS_STDINT_H +// +// Note that GLIBC is a bit inconsistent about whether int64_t is defined or not +// depending upon what headers happen to have been included first... +// so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG. +// See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990 +// +#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG)) // The following #include is an implementation artifact; not part of interface. # ifdef __hpux From 080cd5d4cb6a45525bf2c7226d6f3b035416987a Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 11 Dec 2009 17:46:10 +0000 Subject: [PATCH 42/49] Update cstdint.hpp to always define the INT#_C macros. Try again with Codegear workaround. [SVN r58292] --- include/boost/cstdint.hpp | 68 +++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 030995f9..47e6a160 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -23,6 +23,16 @@ #ifndef BOOST_CSTDINT_HPP #define BOOST_CSTDINT_HPP +// +// Since we always define the INT#_C macros as per C++0x, +// define __STDC_CONSTANT_MACROS so that does the right +// thing if possible, and so that the user knows that the macros +// are actually defined as per C99. +// +#ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +#endif + #include // @@ -348,19 +358,16 @@ namespace boost Macro definition section: -Define various INTXX_C macros only if -__STDC_CONSTANT_MACROS is defined. - -Undefine the macros if __STDC_CONSTANT_MACROS is -not defined and the macros are (cf ). - Added 23rd September 2000 (John Maddock). Modified 11th September 2001 to be excluded when BOOST_HAS_STDINT_H is defined (John Maddock). +Modified 11th Dec 2009 to always define the +INT#_C macros if they're not already defined (John Maddock). ******************************************************/ -#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H) +#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(INT8_C) +#include # define BOOST__STDC_CONSTANT_MACROS_DEFINED # if defined(BOOST_HAS_MS_INT64) // @@ -412,27 +419,40 @@ BOOST_HAS_STDINT_H is defined (John Maddock). // 64-bit types + intmax_t and uintmax_t ----------------------------------// # if defined(BOOST_HAS_LONG_LONG) && \ - (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) + (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX)) # if defined(__hpux) - // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions -# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ - (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || \ - (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) + // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || \ + (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || \ + (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) || \ + (defined(_LLONG_MAX) && _LLONG_MAX == 18446744073709551615ULL) +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif -# define INT64_C(value) value##LL -# define UINT64_C(value) value##uLL # elif ULONG_MAX != 0xffffffff -# if ULONG_MAX == 18446744073709551615 // 2**64 - 1 +# if ULONG_MAX == 18446744073709551615U // 2**64 - 1 # define INT64_C(value) value##L # define UINT64_C(value) value##uL # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif +# elif defined(BOOST_HAS_LONG_LONG) + // Usual macros not defined, work things out for ourselves: +# if(~0uLL == 18446744073709551615ULL) +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp # endif # ifdef BOOST_NO_INT64_T @@ -445,23 +465,7 @@ BOOST_HAS_STDINT_H is defined (John Maddock). # endif // Borland/Microsoft specific width suffixes - -#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) && !defined(BOOST_HAS_STDINT_H) -// -// undef all the macros: -// -# undef INT8_C -# undef INT16_C -# undef INT32_C -# undef INT64_C -# undef UINT8_C -# undef UINT16_C -# undef UINT32_C -# undef UINT64_C -# undef INTMAX_C -# undef UINTMAX_C - -#endif // __STDC_CONSTANT_MACROS_DEFINED etc. +#endif // INT#_C macros. From 2a14f482e696afbd5272d699b78ce0f70dc52cc3 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 12 Jan 2010 18:51:40 +0000 Subject: [PATCH 43/49] Disable warnings when defining INT#_C macros for gcc. [SVN r58948] --- include/boost/cstdint.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 47e6a160..9f5e0711 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -390,6 +390,16 @@ INT#_C macros if they're not already defined (John Maddock). # define UINTMAX_C(value) value##ui64 # else +// For the following code we get several warnings along the lines of: +// +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif + // do it the old fashioned way: // 8-bit types ------------------------------------------------------------// From 89481ebd349d88e21aaa203ba29eedfe271d2879 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 25 Jan 2010 10:55:50 +0000 Subject: [PATCH 44/49] Commit alternative warning suppression code. [SVN r59264] --- include/boost/cstdint.hpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 9f5e0711..ac8c834b 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -390,16 +390,6 @@ INT#_C macros if they're not already defined (John Maddock). # define UINTMAX_C(value) value##ui64 # else -// For the following code we get several warnings along the lines of: -// -// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant -// -// So we declare this a system header to suppress these warnings. - -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif - // do it the old fashioned way: // 8-bit types ------------------------------------------------------------// @@ -431,7 +421,7 @@ INT#_C macros if they're not already defined (John Maddock). # if defined(BOOST_HAS_LONG_LONG) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX)) -# if defined(__hpux) +# if defined(__hpux) || defined(__APPLE__) // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions # define INT64_C(value) value##LL # define UINT64_C(value) value##uLL From 373e516ff500c9965d49c07da15a272dbf67c0b0 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 2 Feb 2010 18:35:33 +0000 Subject: [PATCH 45/49] Change code to check individually for the INT#_C macros before defining them - this correctly handles cases where they are partially defined by other other headers (for example ICU). Also declare this a gcc system header - seems to be the only way to really suppress the warnings - fixes #3889. [SVN r59430] --- include/boost/cstdint.hpp | 45 ++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ac8c834b..ee55e698 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -366,62 +366,91 @@ INT#_C macros if they're not already defined (John Maddock). ******************************************************/ -#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(INT8_C) +#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \ + (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C)) +// +// For the following code we get several warnings along the lines of: +// +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif + #include # define BOOST__STDC_CONSTANT_MACROS_DEFINED # if defined(BOOST_HAS_MS_INT64) // // Borland/Intel/Microsoft compilers have width specific suffixes: // +#ifndef INT8_C # define INT8_C(value) value##i8 +#endif +#ifndef INT16_C # define INT16_C(value) value##i16 +#endif +#ifndef INT32_C # define INT32_C(value) value##i32 +#endif +#ifndef INT64_C # define INT64_C(value) value##i64 +#endif # ifdef __BORLANDC__ // Borland bug: appending ui8 makes the type a signed char # define UINT8_C(value) static_cast(value##u) # else # define UINT8_C(value) value##ui8 # endif +#ifndef UINT16_C # define UINT16_C(value) value##ui16 +#endif +#ifndef UINT32_C # define UINT32_C(value) value##ui32 +#endif +#ifndef UINT64_C # define UINT64_C(value) value##ui64 +#endif +#ifndef INTMAX_C # define INTMAX_C(value) value##i64 # define UINTMAX_C(value) value##ui64 +#endif # else // do it the old fashioned way: // 8-bit types ------------------------------------------------------------// -# if UCHAR_MAX == 0xff +# if (UCHAR_MAX == 0xff) && !defined(INT8_C) # define INT8_C(value) static_cast(value) # define UINT8_C(value) static_cast(value##u) # endif // 16-bit types -----------------------------------------------------------// -# if USHRT_MAX == 0xffff +# if (USHRT_MAX == 0xffff) && !defined(INT16_C) # define INT16_C(value) static_cast(value) # define UINT16_C(value) static_cast(value##u) # endif // 32-bit types -----------------------------------------------------------// - -# if UINT_MAX == 0xffffffff +#ifndef INT32_C +# if (UINT_MAX == 0xffffffff) # define INT32_C(value) value # define UINT32_C(value) value##u # elif ULONG_MAX == 0xffffffff # define INT32_C(value) value##L # define UINT32_C(value) value##uL # endif +#endif // 64-bit types + intmax_t and uintmax_t ----------------------------------// - +#ifndef INT64_C # if defined(BOOST_HAS_LONG_LONG) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX)) -# if defined(__hpux) || defined(__APPLE__) +# if defined(__hpux) // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions # define INT64_C(value) value##LL # define UINT64_C(value) value##uLL @@ -462,7 +491,7 @@ INT#_C macros if they're not already defined (John Maddock). # define INTMAX_C(value) INT64_C(value) # define UINTMAX_C(value) UINT64_C(value) # endif - +#endif # endif // Borland/Microsoft specific width suffixes #endif // INT#_C macros. From 059715dda11effffa0f079d7275fd8fea85a70fc Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 12 Aug 2010 12:36:42 +0000 Subject: [PATCH 46/49] Add VMS support. Fixes #4474. [SVN r64750] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ee55e698..750a1205 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -137,7 +137,7 @@ namespace boost } // namespace boost -#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) +#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) || defined(__VMS) // FreeBSD and Tru64 have an that contains much of what we need. # include From cb470782cf5ca2b383a04751d76b960eca782052 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 5 Sep 2010 16:27:09 +0000 Subject: [PATCH 47/49] Change logic so that int32_t etc is an int rather than a long where possible. [SVN r65299] --- include/boost/cstdint.hpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 750a1205..ea84b650 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -256,20 +256,27 @@ namespace boost // 32-bit types -----------------------------------------------------------// -# if ULONG_MAX == 0xffffffff - typedef long int32_t; - typedef long int_least32_t; - typedef long int_fast32_t; - typedef unsigned long uint32_t; - typedef unsigned long uint_least32_t; - typedef unsigned long uint_fast32_t; -# elif UINT_MAX == 0xffffffff +# if UINT_MAX == 0xffffffff typedef int int32_t; typedef int int_least32_t; typedef int int_fast32_t; typedef unsigned int uint32_t; typedef unsigned int uint_least32_t; typedef unsigned int uint_fast32_t; +# elif (USHRT_MAX == 0xffffffff) + typedef short int32_t; + typedef short int_least32_t; + typedef short int_fast32_t; + typedef unsigned short uint32_t; + typedef unsigned short uint_least32_t; + typedef unsigned short uint_fast32_t; +# elif ULONG_MAX == 0xffffffff + typedef long int32_t; + typedef long int_least32_t; + typedef long int_fast32_t; + typedef unsigned long uint32_t; + typedef unsigned long uint_least32_t; + typedef unsigned long uint_fast32_t; # elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) // Integers are 64 bits on the MTA / XMT typedef __int32 int32_t; From e17e4fe6217562dc477dd632dd2300b0f7795188 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 16 Jun 2013 15:02:27 +0000 Subject: [PATCH 48/49] Extracted intptr_t and uintptr_t types to cstdint.hpp. Refs #7823. [SVN r84805] --- include/boost/cstdint.hpp | 212 ++++++++++++++++++++++---------------- 1 file changed, 123 insertions(+), 89 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ea84b650..1ccf2165 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -1,8 +1,8 @@ // boost cstdint.hpp header file ------------------------------------------// -// (C) Copyright Beman Dawes 1999. -// (C) Copyright Jens Mauer 2001 -// (C) Copyright John Maddock 2001 +// (C) Copyright Beman Dawes 1999. +// (C) Copyright Jens Mauer 2001 +// (C) Copyright John Maddock 2001 // Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -24,9 +24,9 @@ #define BOOST_CSTDINT_HPP // -// Since we always define the INT#_C macros as per C++0x, +// Since we always define the INT#_C macros as per C++0x, // define __STDC_CONSTANT_MACROS so that does the right -// thing if possible, and so that the user knows that the macros +// thing if possible, and so that the user knows that the macros // are actually defined as per C99. // #ifndef __STDC_CONSTANT_MACROS @@ -50,7 +50,7 @@ # ifdef __STDC_32_MODE__ // this is triggered with GCC, because it defines __cplusplus < 199707L # define BOOST_NO_INT64_T -# endif +# endif # elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX) # include # else @@ -100,40 +100,40 @@ typedef ::uintfast64_t uint_fast64_t; namespace boost { - using ::int8_t; - using ::int_least8_t; - using ::int_fast8_t; - using ::uint8_t; - using ::uint_least8_t; - using ::uint_fast8_t; - - using ::int16_t; - using ::int_least16_t; - using ::int_fast16_t; - using ::uint16_t; - using ::uint_least16_t; - using ::uint_fast16_t; - - using ::int32_t; - using ::int_least32_t; - using ::int_fast32_t; - using ::uint32_t; - using ::uint_least32_t; - using ::uint_fast32_t; - + using ::int8_t; + using ::int_least8_t; + using ::int_fast8_t; + using ::uint8_t; + using ::uint_least8_t; + using ::uint_fast8_t; + + using ::int16_t; + using ::int_least16_t; + using ::int_fast16_t; + using ::uint16_t; + using ::uint_least16_t; + using ::uint_fast16_t; + + using ::int32_t; + using ::int_least32_t; + using ::int_fast32_t; + using ::uint32_t; + using ::uint_least32_t; + using ::uint_fast32_t; + # ifndef BOOST_NO_INT64_T - using ::int64_t; - using ::int_least64_t; - using ::int_fast64_t; - using ::uint64_t; - using ::uint_least64_t; - using ::uint_fast64_t; - + using ::int64_t; + using ::int_least64_t; + using ::int_fast64_t; + using ::uint64_t; + using ::uint_least64_t; + using ::uint_fast64_t; + # endif - using ::intmax_t; - using ::uintmax_t; + using ::intmax_t; + using ::uintmax_t; } // namespace boost @@ -143,35 +143,35 @@ namespace boost namespace boost { - using ::int8_t; - typedef int8_t int_least8_t; - typedef int8_t int_fast8_t; - using ::uint8_t; - typedef uint8_t uint_least8_t; - typedef uint8_t uint_fast8_t; - - using ::int16_t; - typedef int16_t int_least16_t; - typedef int16_t int_fast16_t; - using ::uint16_t; - typedef uint16_t uint_least16_t; - typedef uint16_t uint_fast16_t; - - using ::int32_t; - typedef int32_t int_least32_t; - typedef int32_t int_fast32_t; - using ::uint32_t; - typedef uint32_t uint_least32_t; - typedef uint32_t uint_fast32_t; - -# ifndef BOOST_NO_INT64_T + using ::int8_t; + typedef int8_t int_least8_t; + typedef int8_t int_fast8_t; + using ::uint8_t; + typedef uint8_t uint_least8_t; + typedef uint8_t uint_fast8_t; - using ::int64_t; - typedef int64_t int_least64_t; - typedef int64_t int_fast64_t; - using ::uint64_t; - typedef uint64_t uint_least64_t; - typedef uint64_t uint_fast64_t; + using ::int16_t; + typedef int16_t int_least16_t; + typedef int16_t int_fast16_t; + using ::uint16_t; + typedef uint16_t uint_least16_t; + typedef uint16_t uint_fast16_t; + + using ::int32_t; + typedef int32_t int_least32_t; + typedef int32_t int_fast32_t; + using ::uint32_t; + typedef uint32_t uint_least32_t; + typedef uint32_t uint_fast32_t; + +# ifndef BOOST_NO_INT64_T + + using ::int64_t; + typedef int64_t int_least64_t; + typedef int64_t int_fast64_t; + using ::uint64_t; + typedef uint64_t uint_least64_t; + typedef uint64_t uint_fast64_t; typedef int64_t intmax_t; typedef uint64_t uintmax_t; @@ -235,15 +235,15 @@ namespace boost typedef unsigned short uint_least16_t; typedef unsigned short uint_fast16_t; # endif -# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) - // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified - // MTA / XMT does support the following non-standard integer types - typedef __short16 int16_t; - typedef __short16 int_least16_t; - typedef __short16 int_fast16_t; - typedef unsigned __short16 uint16_t; - typedef unsigned __short16 uint_least16_t; - typedef unsigned __short16 uint_fast16_t; +# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) + // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified + // MTA / XMT does support the following non-standard integer types + typedef __short16 int16_t; + typedef __short16 int_least16_t; + typedef __short16 int_fast16_t; + typedef unsigned __short16 uint16_t; + typedef unsigned __short16 uint_least16_t; + typedef unsigned __short16 uint_fast16_t; # elif (USHRT_MAX == 0xffffffff) && defined(CRAY) // no 16-bit types on Cray: typedef short int_least16_t; @@ -277,14 +277,14 @@ namespace boost typedef unsigned long uint32_t; typedef unsigned long uint_least32_t; typedef unsigned long uint_fast32_t; -# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) - // Integers are 64 bits on the MTA / XMT - typedef __int32 int32_t; - typedef __int32 int_least32_t; - typedef __int32 int_fast32_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int32 uint_least32_t; - typedef unsigned __int32 uint_fast32_t; +# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) + // Integers are 64 bits on the MTA / XMT + typedef __int32 int32_t; + typedef __int32 int_least32_t; + typedef __int32 int_fast32_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int32 uint_fast32_t; # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif @@ -358,6 +358,40 @@ namespace boost #endif // BOOST_HAS_STDINT_H +// intptr_t/uintptr_t are defined separately because they are optional and not universally available +#if defined(BOOST_WINDOWS) && !defined(_WIN32_WCE) && !defined(BOOST_HAS_STDINT_H) +// Older MSVC don't have stdint.h and have intptr_t/uintptr_t defined in stddef.h +#include +#endif + +// PGI seems to not support intptr_t/uintptr_t properly. BOOST_HAS_STDINT_H is not defined for this compiler by Boost.Config. +#if !defined(__PGIC__) + +#if (defined(BOOST_WINDOWS) && !defined(_WIN32_WCE)) \ + || (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)) \ + || defined(__CYGWIN__) \ + || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \ + || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) + +namespace boost { + using ::intptr_t; + using ::uintptr_t; +} +#define BOOST_HAS_INTPTR_T + +// Clang pretends to be GCC, so it'll match this condition +#elif defined(__GNUC__) && defined(__INTPTR_TYPE__) && defined(__UINTPTR_TYPE__) + +namespace boost { + typedef __INTPTR_TYPE__ intptr_t; + typedef __UINTPTR_TYPE__ uintptr_t; +} +#define BOOST_HAS_INTPTR_T + +#endif + +#endif // !defined(__PGIC__) + #endif // BOOST_CSTDINT_HPP @@ -376,15 +410,15 @@ INT#_C macros if they're not already defined (John Maddock). #if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \ (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C)) // -// For the following code we get several warnings along the lines of: -// -// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant -// -// So we declare this a system header to suppress these warnings. +// For the following code we get several warnings along the lines of: // -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif #include # define BOOST__STDC_CONSTANT_MACROS_DEFINED From 2bab1f37ffc1cc259a830d91f09fe3d3c85e1319 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 4 Jul 2013 09:13:23 +0000 Subject: [PATCH 49/49] Patch for recent versions of glibc which always assume int64_t support. Fixes #8731. [SVN r84950] --- include/boost/cstdint.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 1ccf2165..98faeae0 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -41,7 +41,10 @@ // so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG. // See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990 // -#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG)) +#if defined(BOOST_HAS_STDINT_H) \ + && (!defined(__GLIBC__) \ + || defined(__GLIBC_HAVE_LONG_LONG) \ + || (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 17))))) // The following #include is an implementation artifact; not part of interface. # ifdef __hpux