_limits.h revision 113941
11103Sjbeloro/*
21103Sjbeloro * Copyright (c) 1988, 1993
31103Sjbeloro *	The Regents of the University of California.  All rights reserved.
41103Sjbeloro *
51103Sjbeloro * Redistribution and use in source and binary forms, with or without
61103Sjbeloro * modification, are permitted provided that the following conditions
71103Sjbeloro * are met:
81103Sjbeloro * 1. Redistributions of source code must retain the above copyright
91103Sjbeloro *    notice, this list of conditions and the following disclaimer.
101103Sjbeloro * 2. Redistributions in binary form must reproduce the above copyright
111103Sjbeloro *    notice, this list of conditions and the following disclaimer in the
121103Sjbeloro *    documentation and/or other materials provided with the distribution.
131103Sjbeloro * 3. All advertising materials mentioning features or use of this software
141103Sjbeloro *    must display the following acknowledgement:
151103Sjbeloro *	This product includes software developed by the University of
161103Sjbeloro *	California, Berkeley and its contributors.
171103Sjbeloro * 4. Neither the name of the University nor the names of its contributors
181103Sjbeloro *    may be used to endorse or promote products derived from this software
191103Sjbeloro *    without specific prior written permission.
201103Sjbeloro *
211103Sjbeloro * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221103Sjbeloro * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2310207SJames.McPherson@Sun.COM * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241103Sjbeloro * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251103Sjbeloro * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261103Sjbeloro * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271103Sjbeloro * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281103Sjbeloro * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291103Sjbeloro * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301103Sjbeloro * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311103Sjbeloro * SUCH DAMAGE.
321103Sjbeloro *
331103Sjbeloro *	@(#)limits.h	8.3 (Berkeley) 1/4/94
341103Sjbeloro * $FreeBSD: head/sys/i386/include/_limits.h 113941 2003-04-23 21:41:59Z kan $
351103Sjbeloro */
361103Sjbeloro
371103Sjbeloro#ifndef _MACHINE__LIMITS_H_
381103Sjbeloro#define	_MACHINE__LIMITS_H_
391103Sjbeloro
401103Sjbeloro#define	__CHAR_BIT	8		/* number of bits in a char */
411103Sjbeloro
421103Sjbeloro#define	__SCHAR_MAX	0x7f		/* max value for a signed char */
431103Sjbeloro#define	__SCHAR_MIN	(-0x7f - 1)	/* min value for a signed char */
441103Sjbeloro
451103Sjbeloro#define	__UCHAR_MAX	0xff		/* max value for an unsigned char */
461103Sjbeloro
471103Sjbeloro#define	__USHRT_MAX	0xffff		/* max value for an unsigned short */
481103Sjbeloro#define	__SHRT_MAX	0x7fff		/* max value for a short */
491103Sjbeloro#define	__SHRT_MIN	(-0x7fff - 1)	/* min value for a short */
501103Sjbeloro
511103Sjbeloro#define	__UINT_MAX	0xffffffffU	/* max value for an unsigned int */
521103Sjbeloro#define	__INT_MAX	0x7fffffff	/* max value for an int */
531103Sjbeloro#define	__INT_MIN	(-0x7fffffff - 1)	/* min value for an int */
541103Sjbeloro
551103Sjbeloro/* Bad hack for gcc configured to give 64-bit longs. */
561103Sjbeloro#ifdef _LARGE_LONG
571103Sjbeloro#define	__ULONG_MAX	0xffffffffffffffffUL
581103Sjbeloro#define	__LONG_MAX	0x7fffffffffffffffL
592606Svenki#define	__LONG_MIN	(-0x7fffffffffffffffL - 1)
602606Svenki#else
612606Svenki#define	__ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
622606Svenki#define	__LONG_MAX	0x7fffffffL	/* max value for a long */
632606Svenki#define	__LONG_MIN	(-0x7fffffffL - 1)	/* min value for a long */
642606Svenki#endif
652606Svenki
661103Sjbeloro			/* max value for an unsigned long long */
671103Sjbeloro#define	__ULLONG_MAX	0xffffffffffffffffULL
681103Sjbeloro#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max value for a long long */
691103Sjbeloro#define	__LLONG_MIN	(-0x7fffffffffffffffLL - 1)  /* min for a long long */
701103Sjbeloro
711103Sjbeloro#define	__SSIZE_MAX	__INT_MAX	/* max value for a ssize_t */
721103Sjbeloro
731103Sjbeloro#define	__SIZE_T_MAX	__UINT_MAX	/* max value for a size_t */
741103Sjbeloro
751103Sjbeloro#define	__OFF_MAX	__LLONG_MAX	/* max value for an off_t */
761103Sjbeloro#define	__OFF_MIN	__LLONG_MIN	/* min value for an off_t */
771103Sjbeloro
781103Sjbeloro/* Quads and long longs are the same size.  Ensure they stay in sync. */
791103Sjbeloro#define	__UQUAD_MAX	__ULLONG_MAX	/* max value for a uquad_t */
801103Sjbeloro#define	__QUAD_MAX	__LLONG_MAX	/* max value for a quad_t */
811103Sjbeloro#define	__QUAD_MIN	__LLONG_MIN	/* min value for a quad_t */
821103Sjbeloro
831103Sjbeloro#ifdef _LARGE_LONG
841103Sjbeloro#define	__LONG_BIT	64
851103Sjbeloro#else
861103Sjbeloro#define	__LONG_BIT	32
871103Sjbeloro#endif
881103Sjbeloro#define	__WORD_BIT	32
891103Sjbeloro
901103Sjbeloro#define	__DBL_DIG	15
911103Sjbeloro#define	__DBL_MAX	1.7976931348623157E+308
921103Sjbeloro#define	__DBL_MIN	2.2250738585072014E-308
931103Sjbeloro
941103Sjbeloro#define	__FLT_DIG	6
951103Sjbeloro#define	__FLT_MAX	3.40282347E+38F
961103Sjbeloro#define	__FLT_MIN	1.17549435E-38F
971103Sjbeloro
981103Sjbeloro#endif /* !_MACHINE__LIMITS_H_ */
991103Sjbeloro