]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
glimits.h (USHRT_MAX): Use unsigned suffix if int can not hold it.
authorVladimir Makarov <vmakarov@toke.toronto.redhat.com>
Tue, 26 Jun 2001 16:56:06 +0000 (16:56 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Tue, 26 Jun 2001 16:56:06 +0000 (16:56 +0000)
2001-06-26  Vladimir Makarov  <vmakarov@toke.toronto.redhat.com>

* glimits.h (USHRT_MAX): Use unsigned suffix if int can not hold
it.

From-SVN: r43584

gcc/ChangeLog
gcc/glimits.h

index 03e00157d7537582417de7881f1fb8dcdbf20495..d1dac4c50de76c03841a376aa9512086401556cd 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-26  Vladimir Makarov  <vmakarov@toke.toronto.redhat.com>
+
+       * glimits.h (USHRT_MAX): Use unsigned suffix if int can not hold
+       it.
+
 2001-06-26  Gabriel Dos Reis  <gdr@codesourcery.com>
 
        * diagnostic.h (struct diagnostic_context): Add new field.
index 979e7155803e65eb83d4f92725fe464945f3a9e9..f0cb0a3bba48e2b3cbce8bfc564460979f1dfbdf 100644 (file)
 #undef SHRT_MAX
 #define SHRT_MAX 32767
 
-/* Maximum value an `unsigned short int' can hold.  (Minimum is 0).  */
-#undef USHRT_MAX
-#define USHRT_MAX 65535
-
 /* Minimum and maximum values a `signed int' can hold.  */
 #ifndef __INT_MAX__
 #define __INT_MAX__ 2147483647
 #undef INT_MAX
 #define INT_MAX __INT_MAX__
 
+/* Maximum value an `unsigned short int' can hold.  (Minimum is 0).  */
+#undef USHRT_MAX
+#if INT_MAX < 65535
+#define USHRT_MAX 65535U
+#else
+#define USHRT_MAX 65535
+#endif
+
 /* Maximum value an `unsigned int' can hold.  (Minimum is 0).  */
 #undef UINT_MAX
 #define UINT_MAX (INT_MAX * 2U + 1)