Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2013 02:47:42 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r259285 - stable/8/contrib/libstdc++/include/std
Message-ID:  <201312130247.rBD2lgJg007418@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Fri Dec 13 02:47:41 2013
New Revision: 259285
URL: http://svnweb.freebsd.org/changeset/base/259285

Log:
  MFC r244673:
  
  Fix the __glibcxx_min and __glibcxx_max macros for a signed wchar_t.
  
  This seems to be needed by newer compilers.

Modified:
  stable/8/contrib/libstdc++/include/std/std_limits.h
Directory Properties:
  stable/8/   (props changed)
  stable/8/contrib/   (props changed)
  stable/8/contrib/libstdc++/   (props changed)

Modified: stable/8/contrib/libstdc++/include/std/std_limits.h
==============================================================================
--- stable/8/contrib/libstdc++/include/std/std_limits.h	Fri Dec 13 02:37:35 2013	(r259284)
+++ stable/8/contrib/libstdc++/include/std/std_limits.h	Fri Dec 13 02:47:41 2013	(r259285)
@@ -134,10 +134,11 @@
 #define __glibcxx_signed(T)	((T)(-1) < 0)
 
 #define __glibcxx_min(T) \
-  (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
+  (__glibcxx_signed (T) ? (((T)1 << (__glibcxx_digits (T) - 1)) << 1) : (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))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312130247.rBD2lgJg007418>