From 68272cf96a958e0af32520aac4159d0ddd2ab93d Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 7 Jul 2000 16:04:40 +0000 Subject: [PATCH 01/97] 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 183e2f2db167941a1ba800d76add0e6808e524e6 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 22 Sep 2000 20:39:23 +0000 Subject: [PATCH 02/97] 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 e8936c8049fc630c5add3c158b40ed0aec9ce70d Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 23 Sep 2000 16:29:01 +0000 Subject: [PATCH 03/97] 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 a35e65284b8ebb275823c9ef1bb46219ac495e66 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 24 Sep 2000 11:35:25 +0000 Subject: [PATCH 04/97] 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 3ac70e772685a8ce95a1ee4d7776880ce5abd752 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 12 Nov 2000 18:35:33 +0000 Subject: [PATCH 05/97] 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 de769d81f04d62460ae8110facaed586106f5978 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 18 Jan 2001 22:44:28 +0000 Subject: [PATCH 06/97] 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 ee950b6b3cc027ee1b05e417ff8dd8be69729407 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 22 Jan 2001 05:06:37 +0000 Subject: [PATCH 07/97] 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 d7e348c88ce7905829ee77a1d2db01ccb6a129ef Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 23 Jan 2001 19:45:00 +0000 Subject: [PATCH 08/97] 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 b1415e18649126db38d15804972c4791cf5290b3 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 24 Jan 2001 12:18:30 +0000 Subject: [PATCH 09/97] 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 1b2df6436ca6ac1028000f31dad61296b7b7793b Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Sun, 11 Feb 2001 01:21:56 +0000 Subject: [PATCH 10/97] 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 48f3621ddcdd996ed6ee0bcb1239dccc663102d3 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 16 Apr 2001 12:53:03 +0000 Subject: [PATCH 11/97] 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 6eadf18b0c47253d9c0e6944dbdd46a1d09f9aa6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 7 May 2001 21:21:13 +0000 Subject: [PATCH 12/97] 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 c5e74ef6b451c6f07256ff2bca9741633e84021b Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 8 May 2001 18:14:14 +0000 Subject: [PATCH 13/97] 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 0afb64c810c584b41eac5f079edb7568f81a8661 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 9 May 2001 21:07:20 +0000 Subject: [PATCH 14/97] 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 0712c3fb73cb314ab37a7c86b84b1a05dfa714dc Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 11 May 2001 10:47:57 +0000 Subject: [PATCH 15/97] 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 7fded5db01d0920d96c911e480b483616619dbbd Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 11 May 2001 17:04:56 +0000 Subject: [PATCH 16/97] 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 6bc60a5b887bf137fd34aeba546588dd00e8f9c5 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 13 May 2001 18:17:15 +0000 Subject: [PATCH 17/97] 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 07f056e30b58ecd35c5ef93ae0f5361dbc6a7f01 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 13 Aug 2001 17:02:48 +0000 Subject: [PATCH 18/97] 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 0ca5fbb950575ddff8d813417fd450bb939bebff Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 18 Sep 2001 11:13:39 +0000 Subject: [PATCH 19/97] 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 a3b5a3129ea25509205ef47fa5765cec60f7ef61 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 20 Sep 2001 19:25:35 +0000 Subject: [PATCH 20/97] 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 56f83da1224b6d5bcfd7265ae6a2b6a15ea18778 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 31 Oct 2001 19:35:59 +0000 Subject: [PATCH 21/97] 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 8c89e17c4f8e535ebb90f616387cfc6d9dac9e60 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 1 Nov 2001 21:52:08 +0000 Subject: [PATCH 22/97] 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 4ffe04359ecea05ab24ee481fcbe2886ebccfca5 Mon Sep 17 00:00:00 2001 From: Darin Adler Date: Sun, 4 Nov 2001 21:53:21 +0000 Subject: [PATCH 23/97] 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 24c34d47f1b014e78e850e2b177107c4a59f2e3e Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 31 Jan 2002 12:58:35 +0000 Subject: [PATCH 24/97] 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 e5b943aacab936feff91efef3a76365c9897d93d Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 4 Aug 2002 01:27:24 +0000 Subject: [PATCH 25/97] 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 eca14f638358fc4883808c89b049b68259f9f76b Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 5 Aug 2002 00:02:10 +0000 Subject: [PATCH 26/97] 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 62a8b9f8588d658daeec8602bc3cd71ed20a5fa6 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 21 Oct 2002 11:00:50 +0000 Subject: [PATCH 27/97] 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 7b7a7ebd3474ae9fb476fe7cda62b690ffc8f821 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 27 Dec 2002 16:51:53 +0000 Subject: [PATCH 28/97] 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 78196511671d72fef82b9e12788756e048f39385 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 22 Jan 2003 12:12:14 +0000 Subject: [PATCH 29/97] 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 677edcd3431afc064be70ade396adcc1f6b7e001 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 24 Jan 2003 11:57:27 +0000 Subject: [PATCH 30/97] 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 77419b2d6238e7898bea491bdb72c54c3ba34aaa Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 22 May 2003 18:09:32 +0000 Subject: [PATCH 31/97] 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 c4f36aa425dc2ca567cbb26d4a78700780da25ad Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 14 Jan 2004 13:30:49 +0000 Subject: [PATCH 32/97] 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 2e9c31c942a7a981805da78168add6c0e9190692 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 10 Aug 2004 12:53:34 +0000 Subject: [PATCH 33/97] 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 67b7f4c37fcb9e5ddabaa911c7713d3fd3e7fe61 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 4 Sep 2004 10:34:49 +0000 Subject: [PATCH 34/97] 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 866cd7fbb80ca889328fbf44e39da88e505991e1 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/97] 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 c9041c7dd44c5d02d7ab18bdbee0017c1cbae653 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 30 May 2005 01:45:13 +0000 Subject: [PATCH 36/97] 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 6e0823298a54388cea01b0ae9a6173c838e00329 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 19 Nov 2005 19:38:13 +0000 Subject: [PATCH 37/97] 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 6c81172a0e1b55216d705eed5e9e385371ae5dbd Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 24 Jan 2006 17:23:54 +0000 Subject: [PATCH 38/97] 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 36712e5063c2fa6292a7bbf9e0b85cc21a39980c Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 14 Jan 2009 10:17:25 +0000 Subject: [PATCH 39/97] 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 900d7d65eeff6fea3d14acc0b1290bcdda41f5cf Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 22 Nov 2009 17:12:57 +0000 Subject: [PATCH 40/97] 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 6ea92679411f60483cebdf233ad393e9fa06074d Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 23 Nov 2009 09:51:23 +0000 Subject: [PATCH 41/97] 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 3ec979d6ce75927bf2bf2057584b46a68ffebd14 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 11 Dec 2009 17:46:10 +0000 Subject: [PATCH 42/97] 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 a2e4d5c7763e9754715b75a6b8eef9f581bdfad3 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 12 Jun 2010 08:33:32 +0000 Subject: [PATCH 43/97] Merge fixes from Trunk. [SVN r62832] --- include/boost/cstdint.hpp | 43 ++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 47e6a160..ee55e698 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -366,58 +366,87 @@ 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)) @@ -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 58e595c560780863e5b83e2a5b711869dfcfa00f Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 2 Oct 2010 12:14:04 +0000 Subject: [PATCH 44/97] Fix logic in cstdint to prefer smaller integers when possible. Improve PP-logic in integer-traits. Suppress some compiler warnings. [SVN r65721] --- include/boost/cstdint.hpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ee55e698..ea84b650 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 @@ -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 7aab77e0422cf000814efdf1bfcb6f5b3ac0c94d Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 20 Jul 2013 17:17:10 +0000 Subject: [PATCH 45/97] Merged recent changes from trunk. [SVN r85088] --- include/boost/cstdint.hpp | 217 ++++++++++++++++++++++---------------- 1 file changed, 127 insertions(+), 90 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ea84b650..98faeae0 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 @@ -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 @@ -50,7 +53,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 +103,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 +146,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 +238,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 +280,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 +361,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 +413,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 ae7bad9e9a94b1ea39e5007dc9eee32005c49128 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 7 Jul 2000 16:04:40 +0000 Subject: [PATCH 46/97] 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 47/97] 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 48/97] 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 49/97] 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 50/97] 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 51/97] 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 52/97] 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 53/97] 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 54/97] 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 55/97] 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 56/97] 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 57/97] 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 58/97] 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 59/97] 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 60/97] 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 61/97] 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 62/97] 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 63/97] 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 64/97] 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 65/97] 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 66/97] 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 67/97] 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 68/97] 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 69/97] 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 70/97] 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 71/97] 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 72/97] 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 73/97] 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 74/97] 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 75/97] 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 76/97] 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 77/97] 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 78/97] 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 79/97] 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 80/97] 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 81/97] 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 82/97] 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 83/97] 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 84/97] 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 85/97] 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 86/97] 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 87/97] 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 88/97] 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 89/97] 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 90/97] 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 91/97] 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 92/97] 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 93/97] 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 94/97] 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 From 98194c63099f395cfccbb2f879fde1a17e6a87cd Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Sat, 31 May 2014 23:35:08 -0700 Subject: [PATCH 95/97] Move cstdint tests to this module --- test/Jamfile.v2 | 3 + test/cstdint_include_test.cpp | 69 ++++++++++ test/cstdint_test.cpp | 238 ++++++++++++++++++++++++++++++++ test/cstdint_test2.cpp | 248 ++++++++++++++++++++++++++++++++++ 4 files changed, 558 insertions(+) create mode 100644 test/cstdint_include_test.cpp create mode 100644 test/cstdint_test.cpp create mode 100644 test/cstdint_test2.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 533df58e..c04efb59 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -66,6 +66,9 @@ test-suite config [ compile-fail threads/test_thread_fail1.cpp ] [ compile-fail threads/test_thread_fail2.cpp ] [ compile boost_fallthrough_test.cpp : [ check-target-builds has_clang_implicit_fallthrough "Clang implicit fallthrough" : clang:"-std=c++11 -Wimplicit-fallthrough" on all ] ] + [ run cstdint_test.cpp : : : all gcc:"-Wno-long-long -Wextra" darwin:-Wno-long-long ] + [ run cstdint_test2.cpp : : : all gcc:"-Wno-long-long -Wextra" darwin:-Wno-long-long ] + [ compile cstdint_include_test.cpp : all gcc:-Wextra ] ; obj has_clang_implicit_fallthrough : cmd_line_check.cpp : diff --git a/test/cstdint_include_test.cpp b/test/cstdint_include_test.cpp new file mode 100644 index 00000000..25d37c82 --- /dev/null +++ b/test/cstdint_include_test.cpp @@ -0,0 +1,69 @@ +// Copyright John Maddock 2009. +// 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) + +#define __STDC_CONSTANT_MACROS +#include // must be the only #include! + +int main() +{ + boost::int8_t i8 = INT8_C(0); + (void)i8; + boost::uint8_t ui8 = UINT8_C(0); + (void)ui8; + boost::int16_t i16 = INT16_C(0); + (void)i16; + boost::uint16_t ui16 = UINT16_C(0); + (void)ui16; + boost::int32_t i32 = INT32_C(0); + (void)i32; + boost::uint32_t ui32 = UINT32_C(0); + (void)ui32; +#ifndef BOOST_NO_INT64_T + boost::int64_t i64 = 0; + (void)i64; + boost::uint64_t ui64 = 0; + (void)ui64; +#endif + boost::int_least8_t i8least = INT8_C(0); + (void)i8least; + boost::uint_least8_t ui8least = UINT8_C(0); + (void)ui8least; + boost::int_least16_t i16least = INT16_C(0); + (void)i16least; + boost::uint_least16_t ui16least = UINT16_C(0); + (void)ui16least; + boost::int_least32_t i32least = INT32_C(0); + (void)i32least; + boost::uint_least32_t ui32least = UINT32_C(0); + (void)ui32least; +#ifndef BOOST_NO_INT64_T + boost::int_least64_t i64least = 0; + (void)i64least; + boost::uint_least64_t ui64least = 0; + (void)ui64least; +#endif + boost::int_fast8_t i8fast = INT8_C(0); + (void)i8fast; + boost::uint_fast8_t ui8fast = UINT8_C(0); + (void)ui8fast; + boost::int_fast16_t i16fast = INT16_C(0); + (void)i16fast; + boost::uint_fast16_t ui16fast = UINT16_C(0); + (void)ui16fast; + boost::int_fast32_t i32fast = INT32_C(0); + (void)i32fast; + boost::uint_fast32_t ui32fast = UINT32_C(0); + (void)ui32fast; +#ifndef BOOST_NO_INT64_T + boost::int_fast64_t i64fast = 0; + (void)i64fast; + boost::uint_fast64_t ui64fast = 0; + (void)ui64fast; +#endif + boost::intmax_t im = 0; + (void)im; + boost::uintmax_t uim = 0; + (void)uim; +} diff --git a/test/cstdint_test.cpp b/test/cstdint_test.cpp new file mode 100644 index 00000000..f3cbd9bb --- /dev/null +++ b/test/cstdint_test.cpp @@ -0,0 +1,238 @@ +// boost cstdint.hpp test program ------------------------------------------// + +// Copyright Beman Dawes 2000. 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. + +// Revision History +// 11 Sep 01 Adapted to work with macros defined in native stdint.h (John Maddock) +// 12 Nov 00 Adapted to merged +// 23 Sep 00 Added INTXX_C constant macro support + int64_t support (John Maddock). +// 28 Jun 00 Initial version + +// +// There are two ways to test this: in version 1, we include cstdint.hpp as the first +// include, which means we get decide whether __STDC_CONSTANT_MACROS is defined. +// In version two we include stdint.h with __STDC_CONSTANT_MACROS *NOT* defined first, +// and check that we still end up with compatible definitions for the INT#_C macros. +// +// This is version 1. +// + +#if defined(__GNUC__) && (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) +// We can't suppress this warning on the command line as not all GCC versions support -Wno-type-limits : +#pragma GCC diagnostic ignored "-Wtype-limits" +#endif + +#include +#include +#include + +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +// +// the following class is designed to verify +// that the various INTXX_C macros can be used +// in integral constant expressions: +// +struct integral_constant_checker +{ + static const boost::int8_t int8 = INT8_C(-127); + static const boost::int_least8_t int_least8 = INT8_C(-127); + static const boost::int_fast8_t int_fast8 = INT8_C(-127); + + static const boost::uint8_t uint8 = UINT8_C(255); + static const boost::uint_least8_t uint_least8 = UINT8_C(255); + static const boost::uint_fast8_t uint_fast8 = UINT8_C(255); + + static const boost::int16_t int16 = INT16_C(-32767); + static const boost::int_least16_t int_least16 = INT16_C(-32767); + static const boost::int_fast16_t int_fast16 = INT16_C(-32767); + + static const boost::uint16_t uint16 = UINT16_C(65535); + static const boost::uint_least16_t uint_least16 = UINT16_C(65535); + static const boost::uint_fast16_t uint_fast16 = UINT16_C(65535); + + static const boost::int32_t int32 = INT32_C(-2147483647); + static const boost::int_least32_t int_least32 = INT32_C(-2147483647); + static const boost::int_fast32_t int_fast32 = INT32_C(-2147483647); + + static const boost::uint32_t uint32 = UINT32_C(4294967295); + static const boost::uint_least32_t uint_least32 = UINT32_C(4294967295); + static const boost::uint_fast32_t uint_fast32 = UINT32_C(4294967295); + + static void check(); +}; + +void integral_constant_checker::check() +{ + BOOST_TEST( int8 == -127 ); + BOOST_TEST( int_least8 == -127 ); + BOOST_TEST( int_fast8 == -127 ); + BOOST_TEST( uint8 == 255u ); + BOOST_TEST( uint_least8 == 255u ); + BOOST_TEST( uint_fast8 == 255u ); + BOOST_TEST( int16 == -32767 ); + BOOST_TEST( int_least16 == -32767 ); + BOOST_TEST( int_fast16 == -32767 ); + BOOST_TEST( uint16 == 65535u ); + BOOST_TEST( uint_least16 == 65535u ); + BOOST_TEST( uint_fast16 == 65535u ); + BOOST_TEST( int32 == -2147483647 ); + BOOST_TEST( int_least32 == -2147483647 ); + BOOST_TEST( int_fast32 == -2147483647 ); + BOOST_TEST( uint32 == 4294967295u ); + BOOST_TEST( uint_least32 == 4294967295u ); + BOOST_TEST( uint_fast32 == 4294967295u ); +} +#endif // BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +// +// the following function simply verifies that the type +// of an integral constant is correctly defined: +// +#ifdef __BORLANDC__ +#pragma option -w-8008 +#pragma option -w-8066 +#endif +template +void integral_constant_type_check(T1, T2) +{ + // + // the types T1 and T2 may not be exactly + // the same type, but they should be the + // same size and signedness. We could use + // numeric_limits to verify this, but + // numeric_limits implementations currently + // vary too much, or are incomplete or missing. + // + T1 t1 = static_cast(-1); // cast suppresses warnings + T2 t2 = static_cast(-1); // ditto +#if defined(BOOST_HAS_STDINT_H) + // if we have a native stdint.h + // then the INTXX_C macros may define + // a type that's wider than required: + BOOST_TEST(sizeof(T1) <= sizeof(T2)); +#else + BOOST_TEST(sizeof(T1) == sizeof(T2)); + BOOST_TEST(t1 == t2); +#endif +#if defined(BOOST_HAS_STDINT_H) + // native headers are permitted to promote small + // unsigned types to type int: + if(sizeof(T1) >= sizeof(int)) + { + if(t1 > 0) + BOOST_TEST(t2 > 0); + else + BOOST_TEST(!(t2 > 0)); + } + else if(t1 < 0) + BOOST_TEST(!(t2 > 0)); +#else + if(t1 > 0) + BOOST_TEST(t2 > 0); + else + BOOST_TEST(!(t2 > 0)); +#endif +} + + +int main(int, char*[]) +{ +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + integral_constant_checker::check(); +#endif + // + // verify the types of the integral constants: + // + integral_constant_type_check(boost::int8_t(0), INT8_C(0)); + integral_constant_type_check(boost::uint8_t(0), UINT8_C(0)); + integral_constant_type_check(boost::int16_t(0), INT16_C(0)); + integral_constant_type_check(boost::uint16_t(0), UINT16_C(0)); + integral_constant_type_check(boost::int32_t(0), INT32_C(0)); + integral_constant_type_check(boost::uint32_t(0), UINT32_C(0)); +#ifndef BOOST_NO_INT64_T + integral_constant_type_check(boost::int64_t(0), INT64_C(0)); + integral_constant_type_check(boost::uint64_t(0), UINT64_C(0)); +#endif + // + boost::int8_t int8 = INT8_C(-127); + boost::int_least8_t int_least8 = INT8_C(-127); + boost::int_fast8_t int_fast8 = INT8_C(-127); + + boost::uint8_t uint8 = UINT8_C(255); + boost::uint_least8_t uint_least8 = UINT8_C(255); + boost::uint_fast8_t uint_fast8 = UINT8_C(255); + + boost::int16_t int16 = INT16_C(-32767); + boost::int_least16_t int_least16 = INT16_C(-32767); + boost::int_fast16_t int_fast16 = INT16_C(-32767); + + boost::uint16_t uint16 = UINT16_C(65535); + boost::uint_least16_t uint_least16 = UINT16_C(65535); + boost::uint_fast16_t uint_fast16 = UINT16_C(65535); + + boost::int32_t int32 = INT32_C(-2147483647); + boost::int_least32_t int_least32 = INT32_C(-2147483647); + boost::int_fast32_t int_fast32 = INT32_C(-2147483647); + + boost::uint32_t uint32 = UINT32_C(4294967295); + boost::uint_least32_t uint_least32 = UINT32_C(4294967295); + boost::uint_fast32_t uint_fast32 = UINT32_C(4294967295); + +#ifndef BOOST_NO_INT64_T + boost::int64_t int64 = INT64_C(-9223372036854775807); + boost::int_least64_t int_least64 = INT64_C(-9223372036854775807); + boost::int_fast64_t int_fast64 = INT64_C(-9223372036854775807); + + boost::uint64_t uint64 = UINT64_C(18446744073709551615); + boost::uint_least64_t uint_least64 = UINT64_C(18446744073709551615); + boost::uint_fast64_t uint_fast64 = UINT64_C(18446744073709551615); + + boost::intmax_t intmax = INTMAX_C(-9223372036854775807); + boost::uintmax_t uintmax = UINTMAX_C(18446744073709551615); +#else + boost::intmax_t intmax = INTMAX_C(-2147483647); + boost::uintmax_t uintmax = UINTMAX_C(4294967295); +#endif + + BOOST_TEST( int8 == -127 ); + BOOST_TEST( int_least8 == -127 ); + BOOST_TEST( int_fast8 == -127 ); + BOOST_TEST( uint8 == 255u ); + BOOST_TEST( uint_least8 == 255u ); + BOOST_TEST( uint_fast8 == 255u ); + BOOST_TEST( int16 == -32767 ); + BOOST_TEST( int_least16 == -32767 ); + BOOST_TEST( int_fast16 == -32767 ); + BOOST_TEST( uint16 == 65535u ); + BOOST_TEST( uint_least16 == 65535u ); + BOOST_TEST( uint_fast16 == 65535u ); + BOOST_TEST( int32 == -2147483647 ); + BOOST_TEST( int_least32 == -2147483647 ); + BOOST_TEST( int_fast32 == -2147483647 ); + BOOST_TEST( uint32 == 4294967295u ); + BOOST_TEST( uint_least32 == 4294967295u ); + BOOST_TEST( uint_fast32 == 4294967295u ); + +#ifndef BOOST_NO_INT64_T + BOOST_TEST( int64 == INT64_C(-9223372036854775807) ); + BOOST_TEST( int_least64 == INT64_C(-9223372036854775807) ); + BOOST_TEST( int_fast64 == INT64_C(-9223372036854775807) ); + BOOST_TEST( uint64 == UINT64_C(18446744073709551615) ); + BOOST_TEST( uint_least64 == UINT64_C(18446744073709551615) ); + BOOST_TEST( uint_fast64 == UINT64_C(18446744073709551615) ); + BOOST_TEST( intmax == INT64_C(-9223372036854775807) ); + BOOST_TEST( uintmax == UINT64_C(18446744073709551615) ); +#else + BOOST_TEST( intmax == -2147483647 ); + BOOST_TEST( uintmax == 4294967295u ); +#endif + + + std::cout << "OK\n"; + return boost::report_errors(); +} diff --git a/test/cstdint_test2.cpp b/test/cstdint_test2.cpp new file mode 100644 index 00000000..91ff28f4 --- /dev/null +++ b/test/cstdint_test2.cpp @@ -0,0 +1,248 @@ +// boost cstdint.hpp test program ------------------------------------------// + +// Copyright Beman Dawes 2000. 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. + +// Revision History +// 11 Sep 01 Adapted to work with macros defined in native stdint.h (John Maddock) +// 12 Nov 00 Adapted to merged +// 23 Sep 00 Added INTXX_C constant macro support + int64_t support (John Maddock). +// 28 Jun 00 Initial version + +// +// There are two ways to test this: in version 1, we include cstdint.hpp as the first +// include, which means we get decide whether __STDC_CONSTANT_MACROS is defined. +// In version two we include stdint.h with __STDC_CONSTANT_MACROS *NOT* defined first, +// and check that we still end up with compatible definitions for the INT#_C macros. +// +// This is version 2. +// + +#if defined(__GNUC__) && (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) +// We can't suppress this warning on the command line as not all GCC versions support -Wno-type-limits : +#pragma GCC diagnostic ignored "-Wtype-limits" +#endif + +#include + +#ifdef BOOST_HAS_STDINT_H +#ifdef __hpux +# include +#else +# include +#endif +#endif + +#include +#include +#include + +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +// +// the following class is designed to verify +// that the various INTXX_C macros can be used +// in integral constant expressions: +// +struct integral_constant_checker +{ + static const boost::int8_t int8 = INT8_C(-127); + static const boost::int_least8_t int_least8 = INT8_C(-127); + static const boost::int_fast8_t int_fast8 = INT8_C(-127); + + static const boost::uint8_t uint8 = UINT8_C(255); + static const boost::uint_least8_t uint_least8 = UINT8_C(255); + static const boost::uint_fast8_t uint_fast8 = UINT8_C(255); + + static const boost::int16_t int16 = INT16_C(-32767); + static const boost::int_least16_t int_least16 = INT16_C(-32767); + static const boost::int_fast16_t int_fast16 = INT16_C(-32767); + + static const boost::uint16_t uint16 = UINT16_C(65535); + static const boost::uint_least16_t uint_least16 = UINT16_C(65535); + static const boost::uint_fast16_t uint_fast16 = UINT16_C(65535); + + static const boost::int32_t int32 = INT32_C(-2147483647); + static const boost::int_least32_t int_least32 = INT32_C(-2147483647); + static const boost::int_fast32_t int_fast32 = INT32_C(-2147483647); + + static const boost::uint32_t uint32 = UINT32_C(4294967295); + static const boost::uint_least32_t uint_least32 = UINT32_C(4294967295); + static const boost::uint_fast32_t uint_fast32 = UINT32_C(4294967295); + + static void check(); +}; + +void integral_constant_checker::check() +{ + BOOST_TEST( int8 == -127 ); + BOOST_TEST( int_least8 == -127 ); + BOOST_TEST( int_fast8 == -127 ); + BOOST_TEST( uint8 == 255u ); + BOOST_TEST( uint_least8 == 255u ); + BOOST_TEST( uint_fast8 == 255u ); + BOOST_TEST( int16 == -32767 ); + BOOST_TEST( int_least16 == -32767 ); + BOOST_TEST( int_fast16 == -32767 ); + BOOST_TEST( uint16 == 65535u ); + BOOST_TEST( uint_least16 == 65535u ); + BOOST_TEST( uint_fast16 == 65535u ); + BOOST_TEST( int32 == -2147483647 ); + BOOST_TEST( int_least32 == -2147483647 ); + BOOST_TEST( int_fast32 == -2147483647 ); + BOOST_TEST( uint32 == 4294967295u ); + BOOST_TEST( uint_least32 == 4294967295u ); + BOOST_TEST( uint_fast32 == 4294967295u ); +} +#endif // BOOST_NO_INCLASS_MEMBER_INITIALIZATION + +// +// the following function simply verifies that the type +// of an integral constant is correctly defined: +// +#ifdef __BORLANDC__ +#pragma option -w-8008 +#pragma option -w-8066 +#endif +template +void integral_constant_type_check(T1, T2) +{ + // + // the types T1 and T2 may not be exactly + // the same type, but they should be the + // same size and signedness. We could use + // numeric_limits to verify this, but + // numeric_limits implementations currently + // vary too much, or are incomplete or missing. + // + T1 t1 = static_cast(-1); // cast suppresses warnings + T2 t2 = static_cast(-1); // ditto +#if defined(BOOST_HAS_STDINT_H) + // if we have a native stdint.h + // then the INTXX_C macros may define + // a type that's wider than required: + BOOST_TEST(sizeof(T1) <= sizeof(T2)); +#else + BOOST_TEST(sizeof(T1) == sizeof(T2)); + BOOST_TEST(t1 == t2); +#endif +#if defined(BOOST_HAS_STDINT_H) + // native headers are permitted to promote small + // unsigned types to type int: + if(sizeof(T1) >= sizeof(int)) + { + if(t1 > 0) + BOOST_TEST(t2 > 0); + else + BOOST_TEST(!(t2 > 0)); + } + else if(t1 < 0) + BOOST_TEST(!(t2 > 0)); +#else + if(t1 > 0) + BOOST_TEST(t2 > 0); + else + BOOST_TEST(!(t2 > 0)); +#endif +} + + +int main(int, char*[]) +{ +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + integral_constant_checker::check(); +#endif + // + // verify the types of the integral constants: + // + integral_constant_type_check(boost::int8_t(0), INT8_C(0)); + integral_constant_type_check(boost::uint8_t(0), UINT8_C(0)); + integral_constant_type_check(boost::int16_t(0), INT16_C(0)); + integral_constant_type_check(boost::uint16_t(0), UINT16_C(0)); + integral_constant_type_check(boost::int32_t(0), INT32_C(0)); + integral_constant_type_check(boost::uint32_t(0), UINT32_C(0)); +#ifndef BOOST_NO_INT64_T + integral_constant_type_check(boost::int64_t(0), INT64_C(0)); + integral_constant_type_check(boost::uint64_t(0), UINT64_C(0)); +#endif + // + boost::int8_t int8 = INT8_C(-127); + boost::int_least8_t int_least8 = INT8_C(-127); + boost::int_fast8_t int_fast8 = INT8_C(-127); + + boost::uint8_t uint8 = UINT8_C(255); + boost::uint_least8_t uint_least8 = UINT8_C(255); + boost::uint_fast8_t uint_fast8 = UINT8_C(255); + + boost::int16_t int16 = INT16_C(-32767); + boost::int_least16_t int_least16 = INT16_C(-32767); + boost::int_fast16_t int_fast16 = INT16_C(-32767); + + boost::uint16_t uint16 = UINT16_C(65535); + boost::uint_least16_t uint_least16 = UINT16_C(65535); + boost::uint_fast16_t uint_fast16 = UINT16_C(65535); + + boost::int32_t int32 = INT32_C(-2147483647); + boost::int_least32_t int_least32 = INT32_C(-2147483647); + boost::int_fast32_t int_fast32 = INT32_C(-2147483647); + + boost::uint32_t uint32 = UINT32_C(4294967295); + boost::uint_least32_t uint_least32 = UINT32_C(4294967295); + boost::uint_fast32_t uint_fast32 = UINT32_C(4294967295); + +#ifndef BOOST_NO_INT64_T + boost::int64_t int64 = INT64_C(-9223372036854775807); + boost::int_least64_t int_least64 = INT64_C(-9223372036854775807); + boost::int_fast64_t int_fast64 = INT64_C(-9223372036854775807); + + boost::uint64_t uint64 = UINT64_C(18446744073709551615); + boost::uint_least64_t uint_least64 = UINT64_C(18446744073709551615); + boost::uint_fast64_t uint_fast64 = UINT64_C(18446744073709551615); + + boost::intmax_t intmax = INTMAX_C(-9223372036854775807); + boost::uintmax_t uintmax = UINTMAX_C(18446744073709551615); +#else + boost::intmax_t intmax = INTMAX_C(-2147483647); + boost::uintmax_t uintmax = UINTMAX_C(4294967295); +#endif + + BOOST_TEST( int8 == -127 ); + BOOST_TEST( int_least8 == -127 ); + BOOST_TEST( int_fast8 == -127 ); + BOOST_TEST( uint8 == 255u ); + BOOST_TEST( uint_least8 == 255u ); + BOOST_TEST( uint_fast8 == 255u ); + BOOST_TEST( int16 == -32767 ); + BOOST_TEST( int_least16 == -32767 ); + BOOST_TEST( int_fast16 == -32767 ); + BOOST_TEST( uint16 == 65535u ); + BOOST_TEST( uint_least16 == 65535u ); + BOOST_TEST( uint_fast16 == 65535u ); + BOOST_TEST( int32 == -2147483647 ); + BOOST_TEST( int_least32 == -2147483647 ); + BOOST_TEST( int_fast32 == -2147483647 ); + BOOST_TEST( uint32 == 4294967295u ); + BOOST_TEST( uint_least32 == 4294967295u ); + BOOST_TEST( uint_fast32 == 4294967295u ); + +#ifndef BOOST_NO_INT64_T + BOOST_TEST( int64 == INT64_C(-9223372036854775807) ); + BOOST_TEST( int_least64 == INT64_C(-9223372036854775807) ); + BOOST_TEST( int_fast64 == INT64_C(-9223372036854775807) ); + BOOST_TEST( uint64 == UINT64_C(18446744073709551615) ); + BOOST_TEST( uint_least64 == UINT64_C(18446744073709551615) ); + BOOST_TEST( uint_fast64 == UINT64_C(18446744073709551615) ); + BOOST_TEST( intmax == INT64_C(-9223372036854775807) ); + BOOST_TEST( uintmax == UINT64_C(18446744073709551615) ); +#else + BOOST_TEST( intmax == -2147483647 ); + BOOST_TEST( uintmax == 4294967295u ); +#endif + + + std::cout << "OK\n"; + return boost::report_errors(); +} From 498b17520ab4aeb078b6af1eae8a0bc124f426d5 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Sun, 1 Jun 2014 02:52:39 -0700 Subject: [PATCH 96/97] Move cstdint docs to this module --- doc/config.qbk | 1 + doc/cstdint.qbk | 139 +++++++++ .../boost_config/boost_macro_reference.html | 6 +- doc/html/boost_config/cstdint.html | 289 ++++++++++++++++++ .../guidelines_for_boost_authors.html | 6 +- doc/html/index.html | 18 +- 6 files changed, 452 insertions(+), 7 deletions(-) create mode 100644 doc/cstdint.qbk create mode 100644 doc/html/boost_config/cstdint.html diff --git a/doc/config.qbk b/doc/config.qbk index 0b02ee80..8e4f6d71 100644 --- a/doc/config.qbk +++ b/doc/config.qbk @@ -50,6 +50,7 @@ Distributed under the Boost Software License, Version 1.0. [include configuring_boost.qbk] [include macro_reference.qbk] +[include cstdint.qbk] [include guidelines.qbk] [include rationale.qbk] [include acknowledgements.qbk] diff --git a/doc/cstdint.qbk b/doc/cstdint.qbk new file mode 100644 index 00000000..3f352075 --- /dev/null +++ b/doc/cstdint.qbk @@ -0,0 +1,139 @@ +[section:cstdint Standard Integer Types] + +[section Overview] + +The header [^[@../../../../boost/cstdint.hpp ]] provides the typedef's useful +for writing portable code that requires certain integer widths. All typedef's are in namespace boost. + +The specifications for these types are based on the ISO/IEC 9899:1999 C Language standard header . +The 64-bit types required by the C standard are ['not required] in the boost header, +and may not be supplied for all platforms/compilers, because [^long long] is not [yet] included in the C++ standard. + +See [@../../test/cstdint_test.cpp cstdint_test.cpp] for a test program. + +[endsect] + +[section:rationale Rationale] + +The organization of the Boost.Integer headers and classes is designed to take advantage of types from the +1999 C standard without causing undefined behavior in terms of the 1998 C++ standard. +The header makes the standard integer types safely available in namespace [^boost] +without placing any names in namespace [^std]. The intension is to complement rather than compete +with the C++ Standard Library. Should some future C++ standard include and , +then will continue to function, but will become redundant and may be safely deprecated. + +Because these are boost headers, their names conform to boost header naming conventions rather than +C++ Standard Library header naming conventions. + +[endsect] + +[section:ce ['Caveat emptor]] + +As an implementation artifact, certain C macro names may possibly be +visible to users of . Don't use these macros; they are not part of +any Boost-specified interface. Use [^boost::integer_traits<>] or [^std::numeric_limits<>] instead. + +As another implementation artifact, certain C typedef names may possibly be visible +in the global namespace to users of . Don't use these names, they are not part of +any Boost-specified interface. Use the respective names in namespace [^boost] instead. + +[endsect] + +[section Exact-width integer types] + +The typedef [^int#_t], with # replaced by the width, designates a signed integer type of exactly # bits; +for example [^int8_t] denotes an 8-bit signed integer type. Similarly, the typedef [^uint#_t] designates an unsigned +integer type of exactly # bits. + +These types are optional. However, if a platform supports integer types with widths of +8, 16, 32, 64, or any combination thereof, then does provide the +corresponding typedefs. + +The absence of int64_t and uint64_t is indicated by the macro `BOOST_NO_INT64_T`. + +[endsect] + +[section Minimum-width integer types] + +The typedef [^int_least#_t], with # replaced by the width, designates a signed integer type with a width +of at least # bits, such that no signed integer type with lesser size has at least the specified width. +Thus, [^int_least32_t] denotes the smallest signed integer type with a width of at least 32 bits. +Similarly, the typedef name [^uint_least#_t] designates an unsigned integer type with a width of at least # bits, +such that no unsigned integer type with lesser size has at least the specified width. + +The following minimum-width integer types are provided for all platforms: + +* [^int_least8_t] +* [^int_least16_t] +* [^int_least32_t] +* [^uint_least8_t] +* [^uint_least16_t] +* [^uint_least32_t] + +The following types are available only if, after including , the macro BOOST_NO_INT64_T is not defined: + +* [^int_least64_t] +* [^uint_least64_t] + + +All other minimum-width integer types are optional. + +[endsect] + +[section Fastest minimum-width integer types] + +The typedef [^int_fast#_t], with # replaced by the width, designates the fastest signed integer type +with a width of at least # bits. Similarly, the typedef name [^uint_fast#_t] designates the fastest +unsigned integer type with a width of at least # bits. + +There is no guarantee that these types are fastest for all purposes. In any case, however, they satisfy +the signedness and width requirements. + +The following fastest minimum-width integer types are provided for all platforms: + +* [^int_fast8_t] +* [^int_fast16_t] +* [^int_fast32_t] +* [^uint_fast8_t] +* [^uint_fast16_t] +* [^uint_fast32_t] + +The following types are available only if, after including , the macro BOOST_NO_INT64_T is not defined: + +* [^int_fast64_t] +* [^uint_fast64_t] + +All other fastest minimum-width integer types are optional. + +[endsect] + +[section Greatest-width integer types] + +The typedef [^intmax_t ]designates a signed integer type capable of representing any value of any signed integer type. + +The typedef [^uintmax_t] designates an unsigned integer type capable of representing any value of any unsigned integer type. + +These types are provided for all platforms. + +[endsect] + +[section Integer Constant Macros] + +The following macros are always defined after inclusion of this header, these allow +integer constants of at least the specified width to be declared: +INT8_C, UINT8_C, INT16_C, UINT16_C, INT32_C, UINT32_C, INTMAX_C, UINTMAX_C. + +The macros INT64_C and UINT64_C are also defined if the the macro BOOST_NO_INT64_T is not defined. + +The C99 macro __STDC_CONSTANT_MACROS is also defined as an artifact of the implementation. + +For example: + + #include + + // Here the constant 0x1FFFFFFFF has the correct suffix applied: + static const boost::uint64_t c = INT64_C(0x1FFFFFFFF); + +[endsect] + +[endsect] diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index 82672fbe..8b104733 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@

-PrevUpHomeNext +PrevUpHomeNext

@@ -5613,7 +5613,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_config/cstdint.html b/doc/html/boost_config/cstdint.html new file mode 100644 index 00000000..450a3e5d --- /dev/null +++ b/doc/html/boost_config/cstdint.html @@ -0,0 +1,289 @@ + + + +Standard Integer Types + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
+ +

+ The header <boost/cstdint.hpp> + provides the typedef's useful for writing portable code that requires certain + integer widths. All typedef's are in namespace boost. +

+

+ The specifications for these types are based on the ISO/IEC 9899:1999 C Language + standard header <stdint.h>. The 64-bit types required by the C standard + are not required in the boost header, and may not be + supplied for all platforms/compilers, because long long + is not [yet] included in the C++ standard. +

+

+ See cstdint_test.cpp for + a test program. +

+
+
+ +

+ The organization of the Boost.Integer headers and classes is designed to + take advantage of <stdint.h> types from the 1999 C standard without + causing undefined behavior in terms of the 1998 C++ standard. The header + <boost/cstdint.hpp> makes the standard integer types safely available + in namespace boost without placing any names in namespace + std. The intension is to complement rather than compete + with the C++ Standard Library. Should some future C++ standard include <stdint.h> + and <cstdint>, then <boost/cstdint.hpp> will continue to function, + but will become redundant and may be safely deprecated. +

+

+ Because these are boost headers, their names conform to boost header naming + conventions rather than C++ Standard Library header naming conventions. +

+
+
+ +

+ As an implementation artifact, certain C <limits.h> macro names may + possibly be visible to users of <boost/cstdint.hpp>. Don't use these + macros; they are not part of any Boost-specified interface. Use boost::integer_traits<> + or std::numeric_limits<> instead. +

+

+ As another implementation artifact, certain C <stdint.h> typedef names + may possibly be visible in the global namespace to users of <boost/cstdint.hpp>. + Don't use these names, they are not part of any Boost-specified interface. + Use the respective names in namespace boost instead. +

+
+
+ +

+ The typedef int#_t, with # replaced by the width, designates + a signed integer type of exactly # bits; for example int8_t + denotes an 8-bit signed integer type. Similarly, the typedef uint#_t + designates an unsigned integer type of exactly # bits. +

+

+ These types are optional. However, if a platform supports integer types with + widths of 8, 16, 32, 64, or any combination thereof, then <boost/cstdint.hpp> + does provide the corresponding typedefs. +

+

+ The absence of int64_t and uint64_t is indicated by the macro BOOST_NO_INT64_T. +

+
+
+ +

+ The typedef int_least#_t, with # replaced by the width, + designates a signed integer type with a width of at least # bits, such that + no signed integer type with lesser size has at least the specified width. + Thus, int_least32_t denotes the smallest signed integer + type with a width of at least 32 bits. Similarly, the typedef name uint_least#_t + designates an unsigned integer type with a width of at least # bits, such + that no unsigned integer type with lesser size has at least the specified + width. +

+

+ The following minimum-width integer types are provided for all platforms: +

+
    +
  • + int_least8_t +
  • +
  • + int_least16_t +
  • +
  • + int_least32_t +
  • +
  • + uint_least8_t +
  • +
  • + uint_least16_t +
  • +
  • + uint_least32_t +
  • +
+

+ The following types are available only if, after including <boost/cstdint.hpp>, + the macro BOOST_NO_INT64_T is not defined: +

+
    +
  • + int_least64_t +
  • +
  • + uint_least64_t +
  • +
+

+ All other minimum-width integer types are optional. +

+
+
+ +

+ The typedef int_fast#_t, with # replaced by the width, + designates the fastest signed integer type with a width of at least # bits. + Similarly, the typedef name uint_fast#_t designates the + fastest unsigned integer type with a width of at least # bits. +

+

+ There is no guarantee that these types are fastest for all purposes. In any + case, however, they satisfy the signedness and width requirements. +

+

+ The following fastest minimum-width integer types are provided for all platforms: +

+
    +
  • + int_fast8_t +
  • +
  • + int_fast16_t +
  • +
  • + int_fast32_t +
  • +
  • + uint_fast8_t +
  • +
  • + uint_fast16_t +
  • +
  • + uint_fast32_t +
  • +
+

+ The following types are available only if, after including <boost/cstdint.hpp>, + the macro BOOST_NO_INT64_T is not defined: +

+
    +
  • + int_fast64_t +
  • +
  • + uint_fast64_t +
  • +
+

+ All other fastest minimum-width integer types are optional. +

+
+
+ +

+ The typedef intmax_t designates a signed integer type + capable of representing any value of any signed integer type. +

+

+ The typedef uintmax_t designates an unsigned integer type + capable of representing any value of any unsigned integer type. +

+

+ These types are provided for all platforms. +

+
+
+ +

+ The following macros are always defined after inclusion of this header, these + allow integer constants of at least the specified width to be declared: INT8_C, + UINT8_C, INT16_C, UINT16_C, INT32_C, UINT32_C, INTMAX_C, UINTMAX_C. +

+

+ The macros INT64_C and UINT64_C are also defined if the the macro BOOST_NO_INT64_T + is not defined. +

+

+ The C99 macro __STDC_CONSTANT_MACROS is also defined as an artifact of the + implementation. +

+

+ For example: +

+
#include <boost/cstdint.hpp>
+
+// Here the constant 0x1FFFFFFFF has the correct suffix applied:
+static const boost::uint64_t c = INT64_C(0x1FFFFFFFF);
+
+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/boost_config/guidelines_for_boost_authors.html b/doc/html/boost_config/guidelines_for_boost_authors.html index 1785ef99..735b1f37 100644 --- a/doc/html/boost_config/guidelines_for_boost_authors.html +++ b/doc/html/boost_config/guidelines_for_boost_authors.html @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@
-PrevUpHomeNext +PrevUpHomeNext

@@ -371,7 +371,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/index.html b/doc/html/index.html index aa46cfd1..b5958af2 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -77,6 +77,22 @@
Macros for libraries with separate source code
+
Standard Integer Types
+
+
Overview
+
Rationale
+
Caveat emptor
+
Exact-width + integer types
+
Minimum-width + integer types
+
Fastest + minimum-width integer types
+
Greatest-width + integer types
+
Integer + Constant Macros
+
Guidelines for Boost Authors
@@ -951,7 +967,7 @@

- +

Last revised: May 31, 2014 at 11:09:07 GMT

Last revised: June 01, 2014 at 09:50:01 GMT


From e008ddb971f6d7ced517950e63ed89479b6d328b Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Sun, 1 Jun 2014 09:22:27 -0700 Subject: [PATCH 97/97] Fix clang error and some warnings --- test/boost_has_pthread_yield.ipp | 1 + test/boost_no_cxx11_ref_qualifiers.ipp | 2 +- test/boost_no_lambdas.ipp | 2 +- test/boost_no_std_allocator.ipp | 2 ++ test/boost_no_unified_init.ipp | 2 ++ 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/boost_has_pthread_yield.ipp b/test/boost_has_pthread_yield.ipp index 625117a0..37046d32 100644 --- a/test/boost_has_pthread_yield.ipp +++ b/test/boost_has_pthread_yield.ipp @@ -18,6 +18,7 @@ void f() { // this is never called, it just has to compile: int res = pthread_yield(); + (void)res; } int test() diff --git a/test/boost_no_cxx11_ref_qualifiers.ipp b/test/boost_no_cxx11_ref_qualifiers.ipp index 4cd8441c..77d1234a 100644 --- a/test/boost_no_cxx11_ref_qualifiers.ipp +++ b/test/boost_no_cxx11_ref_qualifiers.ipp @@ -22,7 +22,7 @@ struct G int test() { G m; - const G c; + const G c = G(); if (m.get() != 'l') return 1; if (c.get() != 'c') return 1; diff --git a/test/boost_no_lambdas.ipp b/test/boost_no_lambdas.ipp index 689f90b6..be412261 100644 --- a/test/boost_no_lambdas.ipp +++ b/test/boost_no_lambdas.ipp @@ -18,7 +18,7 @@ namespace boost_no_cxx11_lambdas { int test() { - [](){}; + (void)[](){}; return 0; } diff --git a/test/boost_no_std_allocator.ipp b/test/boost_no_std_allocator.ipp index da88386b..1c730f39 100644 --- a/test/boost_no_std_allocator.ipp +++ b/test/boost_no_std_allocator.ipp @@ -53,6 +53,8 @@ int test_allocator(const T& i) // and isn't currently required by anything in boost // so don't test for now... // a3 = a2; + + (void)a2; return 0; } diff --git a/test/boost_no_unified_init.ipp b/test/boost_no_unified_init.ipp index a28a223a..428c8f43 100644 --- a/test/boost_no_unified_init.ipp +++ b/test/boost_no_unified_init.ipp @@ -23,6 +23,8 @@ struct AltStruct { public: AltStruct(int x, double y) : x_{x}, y_{y} {} + int X() const { return x_; } + double Y() const { return y_; } private: int x_; double y_;