diff options
author | andrew <andrew@FreeBSD.org> | 2012-12-25 07:37:33 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2012-12-25 07:37:33 +0000 |
commit | 165b4913d0171cbfd278174bb7f1e91684421051 (patch) | |
tree | 0c659ee928c31b7dac32d611bc3d6baa26df576c | |
parent | ae04020c931755237f409e79a2121bc1a6d3ba55 (diff) | |
download | FreeBSD-src-165b4913d0171cbfd278174bb7f1e91684421051.zip FreeBSD-src-165b4913d0171cbfd278174bb7f1e91684421051.tar.gz |
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.
-rw-r--r-- | contrib/libstdc++/include/std/std_limits.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/libstdc++/include/std/std_limits.h b/contrib/libstdc++/include/std/std_limits.h index d1211fd..c4cfcb9 100644 --- a/contrib/libstdc++/include/std/std_limits.h +++ b/contrib/libstdc++/include/std/std_limits.h @@ -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)) |