diff options
-rw-r--r-- | gcc/glimits.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/glimits.h b/gcc/glimits.h index 08cbb403b05..96e254d5f74 100644 --- a/gcc/glimits.h +++ b/gcc/glimits.h @@ -48,36 +48,45 @@ #define USHRT_MAX 65535 /* Minimum and maximum values a `signed int' can hold. */ +#ifndef __INT_MAX__ +#define __INT_MAX__ 2147483647 +#endif #undef INT_MIN #define INT_MIN (-INT_MAX-1) #undef INT_MAX -#define INT_MAX 2147483647 +#define INT_MAX (__INT_MAX__) /* Maximum value an `unsigned int' can hold. (Minimum is 0). */ #undef UINT_MAX -#define UINT_MAX 4294967295U +#define UINT_MAX ((unsigned) INT_MAX * 2 + 1) /* Minimum and maximum values a `signed long int' can hold. (Same as `int'). */ +#ifndef __LONG_MAX__ +#define __LONG_MAX__ 2147483647L +#endif #undef LONG_MIN #define LONG_MIN (-LONG_MAX-1) #undef LONG_MAX -#define LONG_MAX 2147483647L +#define LONG_MAX (__LONG_MAX__) /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ #undef ULONG_MAX -#define ULONG_MAX 4294967295UL +#define ULONG_MAX ((unsigned long) LONG_MAX * 2 + 1) #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) /* Minimum and maximum values a `signed long long int' can hold. */ +#ifndef __LONG_LONG_MAX__ +#define __LONG_LONG_MAX__ 9223372036854775807LL +#endif #undef LONG_LONG_MIN #define LONG_LONG_MIN (-LONG_LONG_MAX-1) #undef LONG_LONG_MAX -#define LONG_LONG_MAX 9223372036854775807LL +#define LONG_LONG_MAX (__LONG_LONG_MAX__) /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ #undef ULONG_LONG_MAX -#define ULONG_LONG_MAX 18446744073709551615ULL +#define ULONG_LONG_MAX ((unsigned long long) LONG_LONG_MAX * 2 + 1) #endif #endif /* _MACH_MACHLIMITS_H_ */ |