111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*	$OpenBSD: limits.h,v 1.5 2007/05/07 20:51:07 kettenis Exp $	*/
211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Copyright (c) 1988, 1993
511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *	The Regents of the University of California.  All rights reserved.
611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Redistribution and use in source and binary forms, with or without
811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * modification, are permitted provided that the following conditions
911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * are met:
1011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * 1. Redistributions of source code must retain the above copyright
1111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *    notice, this list of conditions and the following disclaimer.
1211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * 2. Redistributions in binary form must reproduce the above copyright
1311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *    notice, this list of conditions and the following disclaimer in the
1411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *    documentation and/or other materials provided with the distribution.
1511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * 3. Neither the name of the University nor the names of its contributors
1611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *    may be used to endorse or promote products derived from this software
1711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *    without specific prior written permission.
1811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
1911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * SUCH DAMAGE.
3011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
3111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *	@(#)limits.h	8.3 (Berkeley) 1/4/94
3211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
3311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
3411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#ifndef _MIPS_LIMITS_H_
3511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define _MIPS_LIMITS_H_
3611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
3711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <sys/cdefs.h>
3811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
3911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define	MB_LEN_MAX	6		/* Allow 31 bit UTF2 */
4011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
4111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#ifndef	SIZE_MAX
4211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define	SIZE_MAX	ULONG_MAX	/* max value for a size_t */
4311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#endif
4411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define	SSIZE_MAX	LONG_MAX	/* max value for a ssize_t */
4511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
4611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#if __BSD_VISIBLE
4711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t (historic) */
4811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
4911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Quads and longs are the same on mips64 */
5011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define	UQUAD_MAX	(ULONG_MAX)	/* max value for a uquad_t */
5111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define	QUAD_MAX	(LONG_MAX)	/* max value for a quad_t */
5211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define	QUAD_MIN	(LONG_MIN)	/* min value for a quad_t */
5311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
5411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#endif /* __BSD_VISIBLE */
5511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
5611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
5711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define LONGLONG_BIT    64
5811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define LONGLONG_MIN    (-9223372036854775807LL-1)
5911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define LONGLONG_MAX    9223372036854775807LL
6011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define ULONGLONG_MAX   18446744073709551615ULL
6111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
6211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#endif /* !_MIPS_LIMITS_H_ */
63