diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-16 00:01:24 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-16 00:01:24 +0000 |
commit | 5a303f73cfb00db6013f5227e162543ceb2dabf9 (patch) | |
tree | f6cfbbfff35096e9c989500b0448e3af3421bcea | |
parent | a2a54432470a3303ac9cda8341a9fcc132220dec (diff) | |
download | gcc-5a303f73cfb00db6013f5227e162543ceb2dabf9.tar.gz |
2007-01-15 Ian Lance Taylor <iant@google.com>
Paolo Carlini <pcarlini@suse.de>
* include/ext/type_traits.h: Fix __glibcxx_max macro.
* include/std/limits: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120808 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/ext/type_traits.h | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/std/limits | 5 |
3 files changed, 17 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2a4383c260c..ed498f9400c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2007-01-15 Ian Lance Taylor <iant@google.com> + Paolo Carlini <pcarlini@suse.de> + + * include/ext/type_traits.h: Fix __glibcxx_max macro. + * include/std/limits: Likewise. + 2007-01-15 Paolo Carlini <pcarlini@suse.de> * include/std/valarray (valarray<>::cshift): Fix typo. diff --git a/libstdc++-v3/include/ext/type_traits.h b/libstdc++-v3/include/ext/type_traits.h index d54a5344254..1d931ff7d9d 100644 --- a/libstdc++-v3/include/ext/type_traits.h +++ b/libstdc++-v3/include/ext/type_traits.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -161,7 +161,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) (__glibcxx_signed(_Tp) ? (_Tp)1 << __glibcxx_digits(_Tp) : (_Tp)0) #define __glibcxx_max(_Tp) \ - (__glibcxx_signed(_Tp) ? ((_Tp)1 << __glibcxx_digits(_Tp)) - 1 : ~(_Tp)0) + (__glibcxx_signed(_Tp) ? \ + (((((_Tp)1 << (__glibcxx_digits(_Tp) - 1)) - 1) << 1) + 1) : ~(_Tp)0) template<typename _Value> struct __numeric_traits_integer @@ -197,4 +198,9 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_END_NAMESPACE +#undef __glibcxx_signed +#undef __glibcxx_min +#undef __glibcxx_max +#undef __glibcxx_digits + #endif diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits index d1211fdb59e..fffa875d91f 100644 --- a/libstdc++-v3/include/std/limits +++ b/libstdc++-v3/include/std/limits @@ -1,6 +1,6 @@ // The template and inlines for the numeric_limits classes. -*- C++ -*- -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005 +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -137,7 +137,8 @@ (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0) #define __glibcxx_max(T) \ - (__glibcxx_signed (T) ? ((T)1 << __glibcxx_digits (T)) - 1 : ~(T)0) + (__glibcxx_signed (T) ? \ + (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0) #define __glibcxx_digits(T) \ (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T)) |