Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2013 02:21:33 +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-9@freebsd.org
Subject:   svn commit: r259283 - stable/9/contrib/libstdc++/include/std
Message-ID:  <201312130221.rBD2LXYd099328@svn.freebsd.org>

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

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/9/contrib/libstdc++/include/std/std_limits.h
Directory Properties:
  stable/9/   (props changed)
  stable/9/contrib/libstdc++/   (props changed)

Modified: stable/9/contrib/libstdc++/include/std/std_limits.h
==============================================================================
--- stable/9/contrib/libstdc++/include/std/std_limits.h	Fri Dec 13 01:35:31 2013	(r259282)
+++ stable/9/contrib/libstdc++/include/std/std_limits.h	Fri Dec 13 02:21:32 2013	(r259283)
@@ -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?201312130221.rBD2LXYd099328>