Compare commits

..

12 Commits

Author SHA1 Message Date
0e9f18a7ca This commit was manufactured by cvs2svn to create tag
'Version_1_21_0'.

[SVN r9525]
2001-03-09 14:58:07 +00:00
d39c7cd327 Correct spelling in Jens' licenses
[SVN r9372]
2001-03-01 18:54:36 +00:00
37eb749c49 Fix for BeOS <limits>
[SVN r9356]
2001-02-27 12:52:08 +00:00
8084359fda removed backslashes in macros
[SVN r9097]
2001-02-11 01:21:56 +00:00
f544a58f58 All final 1.20.2 changes, including fixing broken hyperlinks
[SVN r9071]
2001-02-10 14:42:14 +00:00
d2c2e49154 expanded int_least_helper comment on request of Daryle Walker
[SVN r8815]
2001-01-30 21:16:43 +00:00
50bd08d542 cstdint: cygwin fixes for long long support
[SVN r8754]
2001-01-24 12:18:30 +00:00
b5b41c73db for int32_t and intmax_t, prefer "long" over "int" if both are 32bit
[SVN r8743]
2001-01-23 19:45:00 +00:00
a22a9a3d80 Fixes so that long long is recognized for GCC.
[SVN r8706]
2001-01-22 05:06:37 +00:00
21ee723419 restricted Windows/gcc exclusion of int64_t to Cygwin, because
MingW seems to work


[SVN r8641]
2001-01-18 22:44:28 +00:00
202890e032 add typename to definition of (u)int_t::fast
[SVN r8560]
2001-01-12 18:07:34 +00:00
4b2fcb5c36 replace using-directive with using-declarations to avoid ambiguity on IRIX CC
[SVN r8557]
2001-01-11 23:00:32 +00:00
7 changed files with 24 additions and 20 deletions

View File

@ -69,7 +69,7 @@ representing any value of any signed integer type.</p>
capable of representing any value of any unsigned integer type.</p>
<p>These types are required.</p>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->14 Nov 2000<!--webbot bot="Timestamp" endspan i-checksum="15241" -->
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->18 Nov 2000<!--webbot bot="Timestamp" endspan i-checksum="15249" -->
</p>
<p>&nbsp;</p>

View File

@ -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 <boost/stdint.h> (Jens Maurer)
// 23 Sep 00 Added INTXX_C macro support (John Maddock).
// 22 Sep 00 Better 64-bit support (John Maddock)
@ -112,29 +113,28 @@ 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
// 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;
@ -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))
# if(defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615) || \
(defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615)
# define INT64_C(value) value##LL
@ -297,3 +297,4 @@ Added 23rd September (John Maddock).
# undef UINTMAX_C
#endif // __STDC_CONSTANT_MACROS_DEFINED etc.

View File

@ -31,6 +31,7 @@ namespace boost
// specializatons: 1=long, 2=int, 3=short, 4=signed char,
// 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned long
// no specializations for 0 and 5: requests for a type > long are in error
template<> struct int_least_helper<1> { typedef long least; };
template<> struct int_least_helper<2> { typedef int least; };
template<> struct int_least_helper<3> { typedef short least; };
@ -53,7 +54,7 @@ namespace boost
(Bits-1 <= std::numeric_limits<short>::digits) +
(Bits-1 <= std::numeric_limits<signed char>::digits)
>::least least;
typedef int_fast_t<least>::fast fast;
typedef typename int_fast_t<least>::fast fast;
};
// unsigned
@ -68,7 +69,7 @@ namespace boost
(Bits <= std::numeric_limits<unsigned short>::digits) +
(Bits <= std::numeric_limits<unsigned char>::digits)
>::least least;
typedef int_fast_t<least>::fast fast;
typedef typename int_fast_t<least>::fast fast;
};
// The same dispatching technique can be used to select types based on

View File

@ -2,7 +2,7 @@
*
* Copyright Jens Maurer 2000
* Permission to use, copy, modify, sell, and distribute this software
* is hereby granted without free provided that the above copyright notice
* is hereby granted without fee provided that the above copyright notice
* appears in all copies and that both that copyright notice and this
* permission notice appear in supporting documentation,
*

View File

@ -90,7 +90,7 @@ instead.
<hr>
<p>Revised: <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %b %Y" startspan -->14 Nov 2000<!--webbot bot="Timestamp" endspan i-checksum="15241" -->
<p>Revised: <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %b %Y" startspan -->18 Nov 2000<!--webbot bot="Timestamp" endspan i-checksum="15249" -->
</p>
</body>

View File

@ -17,8 +17,6 @@
#include <iostream>
#include <boost/integer.hpp>
using namespace boost; // not the best practice, but useful for testing
namespace
{
void test( long ) { std::cout << "long\n"; }
@ -39,6 +37,8 @@ namespace boost
int main()
{
using boost::int_t;
using boost::uint_t;
std::cout << 32 << ' '; test( int_t<32>::least() );
std::cout << 31 << ' '; test( int_t<31>::least() );
std::cout << 30 << ' '; test( int_t<30>::least() );

View File

@ -70,9 +70,10 @@ int main()
runtest("long", long());
typedef unsigned long unsigned_long;
runtest("unsigned long", unsigned_long());
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_MSVC) && !defined(__BORLANDC__)
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_MSVC) && !defined(__BORLANDC__) && !defined(__BEOS__)
//
// MS/Borland compilers can't support 64-bit member constants
// BeOS doesn't have specialisations for long long in SGI's <limits> header.
runtest("int64_t (possibly long long)", boost::int64_t());
runtest("uint64_t (possibly unsigned long long)", boost::uint64_t());
#endif
@ -80,3 +81,4 @@ int main()
// warning here if "return 0;" is omitted.
return 0;
}