int_limits.h revision 1.1
11.1Scherry/*	$NetBSD: int_limits.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
21.1Scherry
31.1Scherry/*-
41.1Scherry * Copyright (c) 2001 The NetBSD Foundation, Inc.
51.1Scherry * All rights reserved.
61.1Scherry *
71.1Scherry * This code is derived from software contributed to The NetBSD Foundation
81.1Scherry * by Klaus Klein.
91.1Scherry *
101.1Scherry * Redistribution and use in source and binary forms, with or without
111.1Scherry * modification, are permitted provided that the following conditions
121.1Scherry * are met:
131.1Scherry * 1. Redistributions of source code must retain the above copyright
141.1Scherry *    notice, this list of conditions and the following disclaimer.
151.1Scherry * 2. Redistributions in binary form must reproduce the above copyright
161.1Scherry *    notice, this list of conditions and the following disclaimer in the
171.1Scherry *    documentation and/or other materials provided with the distribution.
181.1Scherry * 3. All advertising materials mentioning features or use of this software
191.1Scherry *    must display the following acknowledgement:
201.1Scherry *        This product includes software developed by the NetBSD
211.1Scherry *        Foundation, Inc. and its contributors.
221.1Scherry * 4. Neither the name of The NetBSD Foundation nor the names of its
231.1Scherry *    contributors may be used to endorse or promote products derived
241.1Scherry *    from this software without specific prior written permission.
251.1Scherry *
261.1Scherry * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
271.1Scherry * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
281.1Scherry * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
291.1Scherry * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
301.1Scherry * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
311.1Scherry * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
321.1Scherry * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
331.1Scherry * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
341.1Scherry * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
351.1Scherry * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
361.1Scherry * POSSIBILITY OF SUCH DAMAGE.
371.1Scherry */
381.1Scherry
391.1Scherry#ifndef _IA64_INT_LIMITS_H_
401.1Scherry#define _IA64_INT_LIMITS_H_
411.1Scherry
421.1Scherry/*
431.1Scherry * 7.18.2 Limits of specified-width integer types
441.1Scherry */
451.1Scherry
461.1Scherry/* 7.18.2.1 Limits of exact-width integer types */
471.1Scherry
481.1Scherry/* minimum values of exact-width signed integer types */
491.1Scherry#define	INT8_MIN	(-0x7f-1)			/* int8_t	  */
501.1Scherry#define	INT16_MIN	(-0x7fff-1)			/* int16_t	  */
511.1Scherry#define	INT32_MIN	(-0x7fffffff-1)			/* int32_t	  */
521.1Scherry#define	INT64_MIN	(-0x7fffffffffffffffL-1)	/* int64_t	  */
531.1Scherry
541.1Scherry/* maximum values of exact-width signed integer types */
551.1Scherry#define	INT8_MAX	0x7f				/* int8_t	  */
561.1Scherry#define	INT16_MAX	0x7fff				/* int16_t	  */
571.1Scherry#define	INT32_MAX	0x7fffffff			/* int32_t	  */
581.1Scherry#define	INT64_MAX	0x7fffffffffffffffL		/* int64_t	  */
591.1Scherry
601.1Scherry/* maximum values of exact-width unsigned integer types */
611.1Scherry#define	UINT8_MAX	0xffU				/* uint8_t	  */
621.1Scherry#define	UINT16_MAX	0xffffU				/* uint16_t	  */
631.1Scherry#define	UINT32_MAX	0xffffffffU			/* uint32_t	  */
641.1Scherry#define	UINT64_MAX	0xffffffffffffffffUL		/* uint64_t	  */
651.1Scherry
661.1Scherry/* 7.18.2.2 Limits of minimum-width integer types */
671.1Scherry
681.1Scherry/* minimum values of minimum-width signed integer types */
691.1Scherry#define	INT_LEAST8_MIN	(-0x7f-1)			/* int_least8_t	  */
701.1Scherry#define	INT_LEAST16_MIN	(-0x7fff-1)			/* int_least16_t  */
711.1Scherry#define	INT_LEAST32_MIN	(-0x7fffffff-1)			/* int_least32_t  */
721.1Scherry#define	INT_LEAST64_MIN	(-0x7fffffffffffffffL-1)	/* int_least64_t  */
731.1Scherry
741.1Scherry/* maximum values of minimum-width signed integer types */
751.1Scherry#define	INT_LEAST8_MAX	0x7f				/* int_least8_t	  */
761.1Scherry#define	INT_LEAST16_MAX	0x7fff				/* int_least16_t  */
771.1Scherry#define	INT_LEAST32_MAX	0x7fffffff			/* int_least32_t  */
781.1Scherry#define	INT_LEAST64_MAX	0x7fffffffffffffffL		/* int_least64_t  */
791.1Scherry
801.1Scherry/* maximum values of minimum-width unsigned integer types */
811.1Scherry#define	UINT_LEAST8_MAX	 0xffU				/* uint_least8_t  */
821.1Scherry#define	UINT_LEAST16_MAX 0xffffU			/* uint_least16_t */
831.1Scherry#define	UINT_LEAST32_MAX 0xffffffffU			/* uint_least32_t */
841.1Scherry#define	UINT_LEAST64_MAX 0xffffffffffffffffUL		/* uint_least64_t */
851.1Scherry
861.1Scherry/* 7.18.2.3 Limits of fastest minimum-width integer types */
871.1Scherry
881.1Scherry/* minimum values of fastest minimum-width signed integer types */
891.1Scherry#define	INT_FAST8_MIN	(-0x7fffffff-1)			/* int_fast8_t	  */
901.1Scherry#define	INT_FAST16_MIN	(-0x7fffffff-1)			/* int_fast16_t	  */
911.1Scherry#define	INT_FAST32_MIN	(-0x7fffffff-1)			/* int_fast32_t	  */
921.1Scherry#define	INT_FAST64_MIN	(-0x7fffffffffffffffLL-1)	/* int_fast64_t	  */
931.1Scherry
941.1Scherry/* maximum values of fastest minimum-width signed integer types */
951.1Scherry#define	INT_FAST8_MAX	0x7fffffff			/* int_fast8_t	  */
961.1Scherry#define	INT_FAST16_MAX	0x7fffffff			/* int_fast16_t	  */
971.1Scherry#define	INT_FAST32_MAX	0x7fffffff			/* int_fast32_t	  */
981.1Scherry#define	INT_FAST64_MAX	0x7fffffffffffffffLL		/* int_fast64_t	  */
991.1Scherry
1001.1Scherry/* maximum values of fastest minimum-width unsigned integer types */
1011.1Scherry#define	UINT_FAST8_MAX	0xffffffffU			/* uint_fast8_t	  */
1021.1Scherry#define	UINT_FAST16_MAX	0xffffffffU			/* uint_fast16_t  */
1031.1Scherry#define	UINT_FAST32_MAX	0xffffffffU			/* uint_fast32_t  */
1041.1Scherry#define	UINT_FAST64_MAX	0xffffffffffffffffULL		/* uint_fast64_t  */
1051.1Scherry
1061.1Scherry/* 7.18.2.4 Limits of integer types capable of holding object pointers */
1071.1Scherry
1081.1Scherry#define	INTPTR_MIN	(-0x7fffffffffffffffL-1)	/* intptr_t	  */
1091.1Scherry#define	INTPTR_MAX	0x7fffffffffffffffL		/* intptr_t	  */
1101.1Scherry#define	UINTPTR_MAX	0xffffffffffffffffUL		/* uintptr_t	  */
1111.1Scherry
1121.1Scherry/* 7.18.2.5 Limits of greatest-width integer types */
1131.1Scherry
1141.1Scherry#define	INTMAX_MIN	(-0x7fffffffffffffffL-1)	/* intmax_t	  */
1151.1Scherry#define	INTMAX_MAX	0x7fffffffffffffffL		/* intmax_t	  */
1161.1Scherry#define	UINTMAX_MAX	0xffffffffffffffffUL		/* uintmax_t	  */
1171.1Scherry
1181.1Scherry
1191.1Scherry/*
1201.1Scherry * 7.18.3 Limits of other integer types
1211.1Scherry */
1221.1Scherry
1231.1Scherry/* limits of ptrdiff_t */
1241.1Scherry#define	PTRDIFF_MIN	(-0x7fffffffffffffffL-1)	/* ptrdiff_t	  */
1251.1Scherry#define	PTRDIFF_MAX	0x7fffffffffffffffL		/* ptrdiff_t	  */
1261.1Scherry
1271.1Scherry/* limits of sig_atomic_t */
1281.1Scherry#define	SIG_ATOMIC_MIN	(-0x7fffffffffffffffL-1)	/* sig_atomic_t	  */
1291.1Scherry#define	SIG_ATOMIC_MAX	0x7fffffffffffffffL		/* sig_atomic_t	  */
1301.1Scherry
1311.1Scherry/* limit of size_t */
1321.1Scherry#define	SIZE_MAX	0xffffffffffffffffUL		/* size_t	  */
1331.1Scherry
1341.1Scherry#endif /* !_IA64_INT_LIMITS_H_ */
135