OSDN Git Service

2007-01-15 Ian Lance Taylor <iant@google.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Jan 2007 00:01:24 +0000 (00:01 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Jan 2007 00:01:24 +0000 (00:01 +0000)
    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

libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/type_traits.h
libstdc++-v3/include/std/limits

index 2a4383c..ed498f9 100644 (file)
@@ -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.
index d54a534..1d931ff 100644 (file)
@@ -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 
index d1211fd..fffa875 100644 (file)
@@ -1,6 +1,6 @@
 // The template and inlines for the numeric_limits classes. -*- C++ -*- 
 
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 200
+// 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
   (__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))