int_limits.h revision 1.6
11.6Sskrll/*	$NetBSD: int_limits.h,v 1.6 2023/10/06 11:45:37 skrll 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 *
191.1Scherry * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
201.1Scherry * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
211.1Scherry * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
221.1Scherry * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
231.1Scherry * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
241.1Scherry * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
251.1Scherry * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
261.1Scherry * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
271.1Scherry * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
281.1Scherry * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
291.1Scherry * POSSIBILITY OF SUCH DAMAGE.
301.1Scherry */
311.1Scherry
321.1Scherry#ifndef _IA64_INT_LIMITS_H_
331.1Scherry#define _IA64_INT_LIMITS_H_
341.1Scherry
351.5Smatt#ifdef __SIG_ATOMIC_MAX__
361.5Smatt#include <sys/common_int_limits.h>
371.5Smatt#else
381.1Scherry/*
391.1Scherry * 7.18.2 Limits of specified-width integer types
401.1Scherry */
411.1Scherry
421.1Scherry/* 7.18.2.1 Limits of exact-width integer types */
431.1Scherry
441.1Scherry/* minimum values of exact-width signed integer types */
451.1Scherry#define	INT8_MIN	(-0x7f-1)			/* int8_t	  */
461.1Scherry#define	INT16_MIN	(-0x7fff-1)			/* int16_t	  */
471.1Scherry#define	INT32_MIN	(-0x7fffffff-1)			/* int32_t	  */
481.1Scherry#define	INT64_MIN	(-0x7fffffffffffffffL-1)	/* int64_t	  */
491.1Scherry
501.1Scherry/* maximum values of exact-width signed integer types */
511.1Scherry#define	INT8_MAX	0x7f				/* int8_t	  */
521.1Scherry#define	INT16_MAX	0x7fff				/* int16_t	  */
531.1Scherry#define	INT32_MAX	0x7fffffff			/* int32_t	  */
541.1Scherry#define	INT64_MAX	0x7fffffffffffffffL		/* int64_t	  */
551.1Scherry
561.1Scherry/* maximum values of exact-width unsigned integer types */
571.2Sdrochner#define	UINT8_MAX	0xff				/* uint8_t	  */
581.2Sdrochner#define	UINT16_MAX	0xffff				/* uint16_t	  */
591.1Scherry#define	UINT32_MAX	0xffffffffU			/* uint32_t	  */
601.1Scherry#define	UINT64_MAX	0xffffffffffffffffUL		/* uint64_t	  */
611.1Scherry
621.1Scherry/* 7.18.2.2 Limits of minimum-width integer types */
631.1Scherry
641.1Scherry/* minimum values of minimum-width signed integer types */
651.1Scherry#define	INT_LEAST8_MIN	(-0x7f-1)			/* int_least8_t	  */
661.1Scherry#define	INT_LEAST16_MIN	(-0x7fff-1)			/* int_least16_t  */
671.1Scherry#define	INT_LEAST32_MIN	(-0x7fffffff-1)			/* int_least32_t  */
681.1Scherry#define	INT_LEAST64_MIN	(-0x7fffffffffffffffL-1)	/* int_least64_t  */
691.1Scherry
701.1Scherry/* maximum values of minimum-width signed integer types */
711.1Scherry#define	INT_LEAST8_MAX	0x7f				/* int_least8_t	  */
721.1Scherry#define	INT_LEAST16_MAX	0x7fff				/* int_least16_t  */
731.1Scherry#define	INT_LEAST32_MAX	0x7fffffff			/* int_least32_t  */
741.1Scherry#define	INT_LEAST64_MAX	0x7fffffffffffffffL		/* int_least64_t  */
751.1Scherry
761.1Scherry/* maximum values of minimum-width unsigned integer types */
771.2Sdrochner#define	UINT_LEAST8_MAX	 0xff				/* uint_least8_t  */
781.2Sdrochner#define	UINT_LEAST16_MAX 0xffff				/* uint_least16_t */
791.1Scherry#define	UINT_LEAST32_MAX 0xffffffffU			/* uint_least32_t */
801.1Scherry#define	UINT_LEAST64_MAX 0xffffffffffffffffUL		/* uint_least64_t */
811.1Scherry
821.1Scherry/* 7.18.2.3 Limits of fastest minimum-width integer types */
831.6Sskrll
841.1Scherry/* minimum values of fastest minimum-width signed integer types */
851.1Scherry#define	INT_FAST8_MIN	(-0x7fffffff-1)			/* int_fast8_t	  */
861.1Scherry#define	INT_FAST16_MIN	(-0x7fffffff-1)			/* int_fast16_t	  */
871.1Scherry#define	INT_FAST32_MIN	(-0x7fffffff-1)			/* int_fast32_t	  */
881.1Scherry#define	INT_FAST64_MIN	(-0x7fffffffffffffffLL-1)	/* int_fast64_t	  */
891.1Scherry
901.1Scherry/* maximum values of fastest minimum-width signed integer types */
911.1Scherry#define	INT_FAST8_MAX	0x7fffffff			/* int_fast8_t	  */
921.1Scherry#define	INT_FAST16_MAX	0x7fffffff			/* int_fast16_t	  */
931.1Scherry#define	INT_FAST32_MAX	0x7fffffff			/* int_fast32_t	  */
941.1Scherry#define	INT_FAST64_MAX	0x7fffffffffffffffLL		/* int_fast64_t	  */
951.1Scherry
961.1Scherry/* maximum values of fastest minimum-width unsigned integer types */
971.1Scherry#define	UINT_FAST8_MAX	0xffffffffU			/* uint_fast8_t	  */
981.1Scherry#define	UINT_FAST16_MAX	0xffffffffU			/* uint_fast16_t  */
991.1Scherry#define	UINT_FAST32_MAX	0xffffffffU			/* uint_fast32_t  */
1001.1Scherry#define	UINT_FAST64_MAX	0xffffffffffffffffULL		/* uint_fast64_t  */
1011.1Scherry
1021.1Scherry/* 7.18.2.4 Limits of integer types capable of holding object pointers */
1031.1Scherry
1041.1Scherry#define	INTPTR_MIN	(-0x7fffffffffffffffL-1)	/* intptr_t	  */
1051.1Scherry#define	INTPTR_MAX	0x7fffffffffffffffL		/* intptr_t	  */
1061.1Scherry#define	UINTPTR_MAX	0xffffffffffffffffUL		/* uintptr_t	  */
1071.1Scherry
1081.1Scherry/* 7.18.2.5 Limits of greatest-width integer types */
1091.1Scherry
1101.1Scherry#define	INTMAX_MIN	(-0x7fffffffffffffffL-1)	/* intmax_t	  */
1111.1Scherry#define	INTMAX_MAX	0x7fffffffffffffffL		/* intmax_t	  */
1121.1Scherry#define	UINTMAX_MAX	0xffffffffffffffffUL		/* uintmax_t	  */
1131.1Scherry
1141.1Scherry
1151.1Scherry/*
1161.1Scherry * 7.18.3 Limits of other integer types
1171.1Scherry */
1181.1Scherry
1191.1Scherry/* limits of ptrdiff_t */
1201.1Scherry#define	PTRDIFF_MIN	(-0x7fffffffffffffffL-1)	/* ptrdiff_t	  */
1211.1Scherry#define	PTRDIFF_MAX	0x7fffffffffffffffL		/* ptrdiff_t	  */
1221.1Scherry
1231.1Scherry/* limits of sig_atomic_t */
1241.1Scherry#define	SIG_ATOMIC_MIN	(-0x7fffffffffffffffL-1)	/* sig_atomic_t	  */
1251.1Scherry#define	SIG_ATOMIC_MAX	0x7fffffffffffffffL		/* sig_atomic_t	  */
1261.1Scherry
1271.1Scherry/* limit of size_t */
1281.1Scherry#define	SIZE_MAX	0xffffffffffffffffUL		/* size_t	  */
1291.1Scherry
1301.5Smatt#endif /* !__SIG_ATOMIC_MAX__ */
1311.5Smatt
1321.1Scherry#endif /* !_IA64_INT_LIMITS_H_ */
133