diff options
Diffstat (limited to 'limits.h')
-rw-r--r-- | limits.h | 96 |
1 files changed, 47 insertions, 49 deletions
diff --git a/limits.h b/limits.h index e0cb1986cd..c7b1278638 100644 --- a/limits.h +++ b/limits.h @@ -24,11 +24,15 @@ #ifdef __USE_POSIX /* POSIX adds things to <limits.h>. */ -#include <posix1_lim.h> +# include <posix1_lim.h> #endif #ifdef __USE_POSIX2 -#include <posix2_lim.h> +# include <posix2_lim.h> +#endif + +#ifdef __USE_XOPEN +# include <xopen_lim.h> #endif @@ -47,8 +51,8 @@ /* We only protect from multiple inclusion here, because all the other #include's protect themselves, and in GCC 2 we may #include_next through multiple copies of this file before we get to GCC's. */ -#ifndef _LIMITS_H -#define _LIMITS_H +# ifndef _LIMITS_H +# define _LIMITS_H 1 /* We don't have #include_next. Define ANSI <limits.h> for standard 32-bit words. */ @@ -57,69 +61,63 @@ and 32-bit `int's and `long int's. */ /* Number of bits in a `char'. */ -#define CHAR_BIT 8 +# define CHAR_BIT 8 /* Maximum length of any multibyte character in any locale. */ -#define MB_LEN_MAX 6 +# define MB_LEN_MAX 6 /* Minimum and maximum values a `signed char' can hold. */ -#define SCHAR_MIN (-128) -#define SCHAR_MAX 127 +# define SCHAR_MIN (-128) +# define SCHAR_MAX 127 /* Maximum value an `unsigned char' can hold. (Minimum is 0.) */ -#ifdef __STDC__ -#define UCHAR_MAX 255U -#else -#define UCHAR_MAX 255 -#endif +# define UCHAR_MAX 255 /* Minimum and maximum values a `char' can hold. */ -#ifdef __CHAR_UNSIGNED__ -#define CHAR_MIN 0 -#define CHAR_MAX UCHAR_MAX -#else -#define CHAR_MIN SCHAR_MIN -#define CHAR_MAX SCHAR_MAX -#endif +# ifdef __CHAR_UNSIGNED__ +# define CHAR_MIN 0 +# define CHAR_MAX UCHAR_MAX +# else +# define CHAR_MIN SCHAR_MIN +# define CHAR_MAX SCHAR_MAX +# endif /* Minimum and maximum values a `signed short int' can hold. */ -#define SHRT_MIN (-32768) -#define SHRT_MAX 32767 +# define SHRT_MIN (-32768) +# define SHRT_MAX 32767 /* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */ -#define USHRT_MAX 65535 +# define USHRT_MAX 65535 /* Minimum and maximum values a `signed int' can hold. */ -#define INT_MIN (- INT_MAX - 1) -#define INT_MAX 2147483647 +# define INT_MIN (- INT_MAX - 1) +# define INT_MAX 2147483647 /* Maximum value an `unsigned int' can hold. (Minimum is 0.) */ -#ifdef __STDC__ -#define UINT_MAX 4294967295U -#else -#define UINT_MAX 4294967295 -#endif - -#ifdef __alpha__ +# ifdef __STDC__ +# define UINT_MAX 4294967295U +# else +# define UINT_MAX 4294967295 +# endif /* Minimum and maximum values a `signed long int' can hold. */ -#define LONG_MAX 9223372036854775807L -#define LONG_MIN (- LONG_MAX - 1L) +# ifdef __alpha__ +# define LONG_MAX 9223372036854775807L +# else +# define LONG_MAX 2147483647L +# endif +# define LONG_MIN (- LONG_MAX - 1L) /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */ -#define ULONG_MAX 18446744073709551615L - -#else - -/* Minimum and maximum values a `signed long int' can hold. */ -#define LONG_MAX INT_MAX -#define LONG_MIN INT_MIN - -/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */ -#define ULONG_MAX UINT_MAX - -#endif - - -#endif /* limits.h */ +# ifdef __alpha__ +# define ULONG_MAX 18446744073709551615UL +# else +# ifdef __STDC__ +# define ULONG_MAX 4294967295UL +# else +# define ULONG_MAX 4294967295L +# endif +# endif + +# endif /* limits.h */ #endif /* GCC 2. */ |