From owner-svn-src-all@FreeBSD.ORG Tue Dec 25 07:37:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F405D09; Tue, 25 Dec 2012 07:37:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 528F58FC12; Tue, 25 Dec 2012 07:37:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBP7bYwE011466; Tue, 25 Dec 2012 07:37:34 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBP7bYeh011465; Tue, 25 Dec 2012 07:37:34 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212250737.qBP7bYeh011465@svn.freebsd.org> From: Andrew Turner Date: Tue, 25 Dec 2012 07:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244673 - head/contrib/libstdc++/include/std X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Dec 2012 07:37:34 -0000 Author: andrew Date: Tue Dec 25 07:37:33 2012 New Revision: 244673 URL: http://svnweb.freebsd.org/changeset/base/244673 Log: Fix the __glibcxx_min and __glibcxx_max macros for a signed wchar_t. * The __glibcxx_max macro came from GCC svn r138078, the last GPLv2 revision of this file. * I wrote the updated __glibcxx_min macro. Modified: head/contrib/libstdc++/include/std/std_limits.h Modified: head/contrib/libstdc++/include/std/std_limits.h ============================================================================== --- head/contrib/libstdc++/include/std/std_limits.h Tue Dec 25 07:29:25 2012 (r244672) +++ head/contrib/libstdc++/include/std/std_limits.h Tue Dec 25 07:37:33 2012 (r244673) @@ -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))