summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-06 21:44:58 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-06 21:44:58 +0000
commit47a6d1ac3e2f567ab02e0d38a69760eff1a78268 (patch)
tree5fb5f045bf7c439bb46b998f2e12fa1bb7b825c9
parentb1c4a146330b63ff2d2ad465bd84fa8b592e5805 (diff)
downloadppe42-gcc-47a6d1ac3e2f567ab02e0d38a69760eff1a78268.tar.gz
ppe42-gcc-47a6d1ac3e2f567ab02e0d38a69760eff1a78268.zip
* glimits.h (__SHRT_MAX__): New.
(SHRT_MIN, USHRT_MAX): Define in terms of SHRT_MAX. (SHRT_MAX): Define in terms of __SHRT_MAX__. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43825 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/glimits.h15
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f6d86660890..f361306ce03 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-06 Roman Lechtchinsky <rl@cs.tu-berlin.de>
+
+ * glimits.h (__SHRT_MAX__): New.
+ (SHRT_MIN, USHRT_MAX): Define in terms of SHRT_MAX.
+ (SHRT_MAX): Define in terms of __SHRT_MAX__.
+
2001-07-06 Jan van Male <jan.vanmale@fenk.wau.nl>
* alias.c (base_alias_check): Cast GET_MODE_UNIT_SIZE to int to
diff --git a/gcc/glimits.h b/gcc/glimits.h
index f0cb0a3bba4..bdf7e31ad38 100644
--- a/gcc/glimits.h
+++ b/gcc/glimits.h
@@ -37,12 +37,15 @@
#define CHAR_MAX 127
#endif
+#ifndef __SHRT_MAX__
+#define __SHRT_MAX__ 32767
+#endif
+
/* Minimum and maximum values a `signed short int' can hold. */
#undef SHRT_MIN
-/* For the sake of 16 bit hosts, we may not use -32768 */
-#define SHRT_MIN (-32767-1)
+#define SHRT_MIN (-SHRT_MAX-1)
#undef SHRT_MAX
-#define SHRT_MAX 32767
+#define SHRT_MAX __SHRT_MAX__
/* Minimum and maximum values a `signed int' can hold. */
#ifndef __INT_MAX__
@@ -55,10 +58,10 @@
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
#undef USHRT_MAX
-#if INT_MAX < 65535
-#define USHRT_MAX 65535U
+#if __SHRT_MAX__ == __INT_MAX__
+#define USHRT_MAX (SHRT_MAX * 2U + 1U)
#else
-#define USHRT_MAX 65535
+#define USHRT_MAX (SHRT_MAX * 2 + 1)
#endif
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
OpenPOWER on IntegriCloud