diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 1999-05-20 23:33:35 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 1999-05-20 23:33:35 +0000 |
commit | 80a290844ba86bb43f9a544c8060ae7ef6fef597 (patch) | |
tree | 18de6acd0606f347cc7cfbdbec56bdedefc6e9b3 /sys/i386/include/_limits.h | |
parent | 49936df39b1323bc18e4438425356a0a2db7df3c (diff) | |
download | src-80a290844ba86bb43f9a544c8060ae7ef6fef597.tar.gz src-80a290844ba86bb43f9a544c8060ae7ef6fef597.zip |
Set CHAR_{MIN,MAX} according to -funsigned-char flag given or not
PR: 11627
Submitted by: Petr Lampa <lampa@fee.vutbr.cz>
Notes
Notes:
svn path=/head/; revision=47347
Diffstat (limited to 'sys/i386/include/_limits.h')
-rw-r--r-- | sys/i386/include/_limits.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/i386/include/_limits.h b/sys/i386/include/_limits.h index 602bb61b362b..8aabe24c3440 100644 --- a/sys/i386/include/_limits.h +++ b/sys/i386/include/_limits.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)limits.h 8.3 (Berkeley) 1/4/94 - * $Id$ + * $Id: limits.h,v 1.11 1997/02/22 09:34:47 peter Exp $ */ #ifndef _MACHINE_LIMITS_H_ @@ -54,8 +54,14 @@ #define SCHAR_MIN (-128) /* max value for a signed char */ #define UCHAR_MAX 255 /* max value for an unsigned char */ -#define CHAR_MAX 127 /* max value for a char */ -#define CHAR_MIN (-128) /* min value for a char */ + +#ifdef __CHAR_UNSIGNED__ +# define CHAR_MIN 0 /* min value for a char */ +# define CHAR_MAX UCHAR_MAX /* max value for a char */ +#else +# define CHAR_MIN SCHAR_MIN /* min value for a char */ +# define CHAR_MAX SCHAR_MAX /* max value for a char */ +#endif #define USHRT_MAX 65535 /* max value for an unsigned short */ #define SHRT_MAX 32767 /* max value for a short */ |