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
+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.
// -*- 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
(__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
_GLIBCXX_END_NAMESPACE
+#undef __glibcxx_signed
+#undef __glibcxx_min
+#undef __glibcxx_max
+#undef __glibcxx_digits
+
#endif
// 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
(__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))