xref: /csrg-svn/sys/hp300/include/limits.h (revision 59788)
136797Sbostic /*
236797Sbostic  * Copyright (c) 1988 The Regents of the University of California.
336797Sbostic  * All rights reserved.
436797Sbostic  *
544541Sbostic  * %sccs.include.redist.c%
636797Sbostic  *
7*59788Sbostic  *	@(#)limits.h	7.7 (Berkeley) 05/07/93
836797Sbostic  */
936797Sbostic 
1036797Sbostic #define	CHAR_BIT	8		/* number of bits in a char */
1136797Sbostic #define	MB_LEN_MAX	1		/* no multibyte characters */
1236797Sbostic 
1352899Sbostic #define	CLK_TCK		60		/* ticks per second */
1452899Sbostic 
1552899Sbostic /*
1652899Sbostic  * According to ANSI (section 2.2.4.2), the values below must be usable by
1752899Sbostic  * #if preprocessing directives.  Additionally, the expression must have the
1852899Sbostic  * same type as would an expression that is an object of the corresponding
1952899Sbostic  * type converted according to the integral promotions.  The subtraction for
2052899Sbostic  * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an
2152899Sbostic  * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
22*59788Sbostic  * These numbers work for pcc as well.  The UINT_MAX and ULONG_MAX values
23*59788Sbostic  * are written as hex so that GCC will be quiet about large integer constants.
2452899Sbostic  */
2552898Sbostic #define	SCHAR_MAX	127		/* min value for a signed char */
2652898Sbostic #define	SCHAR_MIN	-128		/* max value for a signed char */
2736797Sbostic 
2852898Sbostic #define	UCHAR_MAX	255		/* max value for an unsigned char */
2952898Sbostic #define	CHAR_MAX	127		/* max value for a char */
3052899Sbostic #define	CHAR_MIN	-128		/* min value for a char */
3136797Sbostic 
3252898Sbostic #define	USHRT_MAX	65535		/* max value for an unsigned short */
3352898Sbostic #define	SHRT_MAX	32767		/* max value for a short */
3452898Sbostic #define	SHRT_MIN	-32768		/* min value for a short */
3536797Sbostic 
36*59788Sbostic #define	UINT_MAX	0xffffffff	/* max value for an unsigned int */
3752898Sbostic #define	INT_MAX		2147483647	/* max value for an int */
3852898Sbostic #define	INT_MIN		(-2147483647-1)	/* min value for an int */
3936797Sbostic 
40*59788Sbostic #define	ULONG_MAX	0xffffffff	/* max value for an unsigned long */
4152898Sbostic #define	LONG_MAX	2147483647	/* max value for a long */
4252898Sbostic #define	LONG_MIN	(-2147483647-1)	/* min value for a long */
4354360Sbostic 
4454360Sbostic /* Maximum/minimum values for types from <machine/include/ansi.h>. */
4554360Sbostic #ifndef _ANSI_SOURCE
4654417Sbostic 
4754417Sbostic /* Quad constants must be written as expressions; #define GCC_ME_HARDER. */
4854417Sbostic #define	UQUAD_MAX	((u_quad_t)0-1)	/* max value for a uquad_t */
4954417Sbostic 					/* max value for a quad_t */
5054417Sbostic #define	QUAD_MAX	((quad_t)(UQUAD_MAX >> 1))
5154417Sbostic #define	QUAD_MIN	(-QUAD_MAX-1)	/* min value for a quad_t */
5254417Sbostic 
5354360Sbostic #define	SIZE_T_MAX	UINT_MAX
5454360Sbostic #endif
55