aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edelsohn <edelsohn@gnu.org>2001-07-23 16:41:03 +0000
committerDavid Edelsohn <dje@gcc.gnu.org>2001-07-23 12:41:03 -0400
commitcba6dfc843af5480bba2bc7158eb70f69495f9d1 (patch)
treebd5be6843160a95147005f7dde2ac894cc153c86
parent1ee6b83994e6f6ff8b95bf2cd9db98b0236079a5 (diff)
downloadgcc-cba6dfc843af5480bba2bc7158eb70f69495f9d1.zip
gcc-cba6dfc843af5480bba2bc7158eb70f69495f9d1.tar.gz
gcc-cba6dfc843af5480bba2bc7158eb70f69495f9d1.tar.bz2
limits_generic.h (int): Set digits and digits10 appropriately for word size.
* include/bits/limits_generic.h (int): Set digits and digits10 appropriately for word size. (unsigned int,long,unsigned long): Likewise. From-SVN: r44271
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/include/bits/limits_generic.h26
2 files changed, 32 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 0e0c847..e4df055 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-23 David Edelsohn <edelsohn@gnu.org>
+
+ * include/bits/limits_generic.h (int): Set digits and digits10
+ appropriately for word size.
+ (unsigned int,long,unsigned long): Likewise.
+
2001-07-19 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
* include/bits/stl_algo.h : Fix typos.
diff --git a/libstdc++-v3/include/bits/limits_generic.h b/libstdc++-v3/include/bits/limits_generic.h
index 42cae71..a5dd299 100644
--- a/libstdc++-v3/include/bits/limits_generic.h
+++ b/libstdc++-v3/include/bits/limits_generic.h
@@ -469,8 +469,13 @@ namespace std {
static int max() throw()
{ return INT_MAX; }
+#if INT_MAX > 32767
static const int digits = 31;
static const int digits10 = 9;
+#else
+ static const int digits = 15;
+ static const int digits10 = 4;
+#endif
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
@@ -517,8 +522,13 @@ namespace std {
static unsigned int max() throw()
{ return UINT_MAX; }
+#if INT_MAX > 32767
static const int digits = 32;
static const int digits10 = 9;
+#else
+ static const int digits = 16;
+ static const int digits10 = 4;
+#endif
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
@@ -565,8 +575,16 @@ namespace std {
static long max() throw()
{ return LONG_MAX; }
+#if LONG_MAX > 2147483647
+ static const int digits = 63;
+ static const int digits10 = 18;
+#elif LONG_MAX > 32767
static const int digits = 31;
static const int digits10 = 9;
+#else
+ static const int digits = 15;
+ static const int digits10 = 4;
+#endif
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
@@ -613,8 +631,16 @@ namespace std {
static unsigned long max() throw()
{ return ULONG_MAX; }
+#if LONG_MAX > 2147483647
+ static const int digits = 64;
+ static const int digits10 = 19;
+#elif LONG_MAX > 32767
static const int digits = 32;
static const int digits10 = 9;
+#else
+ static const int digits = 16;
+ static const int digits10 = 4;
+#endif
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;