/*
 * Copyright (c) 1996-2004 MIPS Technologies, Inc.
 * 
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 
 *      * Redistributions of source code must retain the above copyright
 *        notice, this list of conditions and the following disclaimer.
 *      * Redistributions in binary form must reproduce the above
 *      copyright
 *        notice, this list of conditions and the following disclaimer
 *        in the documentation and/or other materials provided with
 *        the distribution.
 *      * Neither the name of MIPS Technologies Inc. nor the names of its
 *        contributors may be used to endorse or promote products derived
 *        from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * limits.h : MIPS machine limits
 */


#ifndef _LIMITS_H___
#define _LIMITS_H___

#define CHAR_BIT 	8

#define SCHAR_MAX	0x7f
#define SCHAR_MIN 	(-0x7f-1)
#define UCHAR_MAX	0xff

#ifdef __CHAR_UNSIGNED__
#define CHAR_MAX 	0xff
#define CHAR_MIN 	0
#else
#define CHAR_MAX 	0x7f
#define CHAR_MIN 	(-0x7f-1)
#endif

#define SHRT_MAX 	0x7fff
#define SHRT_MIN 	(-0x7fff-1)
#define USHRT_MAX 	0xffffU

#define INT_MAX 	0x7fffffff
#define INT_MIN 	(-0x7fffffff-1)
#define UINT_MAX 	0xffffffffU

#define LONG_MAX 	0x7fffffff
#define LONG_MIN 	(-0x7fffffff-1)
#define ULONG_MAX 	0xffffffffU

#ifndef __STRICT_ANSI__
/* GCC extension */
#define LONG_LONG_MAX	0x7fffffffffffffffLL
#define LONG_LONG_MIN	(-0x7fffffffffffffffLL-1)
#define ULONG_LONG_MAX	0xffffffffffffffffULL
#endif /* !__STRICT_ANSI__ */

#if __STDC_VERSION__ >= 199901L
/* ISO C 9X draft */
#define	LLONG_MAX	0x7fffffffffffffffLL
#define	LLONG_MIN	(-0x7fffffffffffffffLL-1)
#define	ULLONG_MAX	0xffffffffffffffffULL
#endif

#if !defined(_ANSI_SOURCE)
/* see <machine/ansi.h> for typedefs */
#define	SSIZE_MAX	LONG_MAX	/* max value for a ssize_t */
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
#define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */
#endif
#endif

/* Max length of multibyte character in any locale. */
#define MB_LEN_MAX 	16

#endif /* _LIMITS_H___ */
