mirror of
https://github.com/boostorg/config.git
synced 2025-11-03 09:11:37 +01:00
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]
This commit is contained in:
@@ -16,8 +16,13 @@ namespace boost_has_long_long{
|
||||
|
||||
int test()
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
__extension__ long long lli = 0LL;
|
||||
__extension__ unsigned long long ulli = 0uLL;
|
||||
#else
|
||||
long long lli = 0LL;
|
||||
unsigned long long ulli = 0uLL;
|
||||
#endif
|
||||
(void)&lli;
|
||||
(void)&ulli;
|
||||
return 0;
|
||||
|
||||
@@ -23,11 +23,20 @@ struct llt
|
||||
enum{ value = m };
|
||||
};
|
||||
#else
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
static const unsigned long long mask = 1uLL << 50;
|
||||
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
template <unsigned long long m>
|
||||
struct llt
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
static const unsigned long long value = m;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -16,8 +16,16 @@ namespace boost_no_long_long_numeric_limits{
|
||||
|
||||
int test()
|
||||
{
|
||||
if(0 == std::numeric_limits<long long>::is_specialized) return -1;
|
||||
if(0 == std::numeric_limits<unsigned long long>::is_specialized) return -1;
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
typedef long long llt;
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
typedef unsigned long long ullt;
|
||||
if(0 == std::numeric_limits<llt>::is_specialized) return -1;
|
||||
if(0 == std::numeric_limits<ullt>::is_specialized) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -170,10 +170,8 @@ int test_main(int, char*[])
|
||||
typedef unsigned long unsigned_long;
|
||||
test_integral_limits(unsigned_long(), "unsigned long");
|
||||
#if defined(BOOST_HAS_LONG_LONG)
|
||||
typedef long long long_long;
|
||||
test_integral_limits(long_long(), "long long");
|
||||
typedef unsigned long long unsigned_long_long;
|
||||
test_integral_limits(unsigned_long_long(), "unsigned long long");
|
||||
test_integral_limits(::boost::long_long_type(), "long long");
|
||||
test_integral_limits(::boost::ulong_long_type(), "unsigned long long");
|
||||
#endif
|
||||
#ifdef BOOST_HAS_MS_INT64
|
||||
typedef __int64 long_long2;
|
||||
|
||||
Reference in New Issue
Block a user