diff options
author | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-09-02 21:39:58 +0000 |
---|---|---|
committer | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-09-02 21:39:58 +0000 |
commit | 9e6911296d4806bd341cfcbfc409e97a3a7d6823 (patch) | |
tree | 15d44508486c82f0682c1f0512f93ab0b4423a81 /gcc/glimits.h | |
parent | 3ef58cb9c7e7dfad135bffc967115bc924708d33 (diff) | |
download | gcc-9e6911296d4806bd341cfcbfc409e97a3a7d6823.tar.gz |
(__INT_MAX__, __LONG_MAX__, __LONG_LONG_MAX__): New macros.
(INT_MAX, LONG_MAX, LONG_LONG_MAX): Use them.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5252 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/glimits.h')
-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_ */ |