sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: #ifndef _LIMITS_H_ sl@0: #define _LIMITS_H_ sl@0: /** sl@0: Number of bits in a `char'. sl@0: */ sl@0: #define CHAR_BIT 8 sl@0: sl@0: /** sl@0: Maximum length of any multibyte character in any locale. sl@0: Locale-writers should change this as necessary. sl@0: */ sl@0: #define MB_LEN_MAX 2 sl@0: sl@0: /** sl@0: Minimum and maximum values a `signed char' can hold. sl@0: */ sl@0: #define SCHAR_MIN (-128) sl@0: #define SCHAR_MAX 127 sl@0: sl@0: /** sl@0: Maximum value an `unsigned char' can hold. (Minimum is 0.) sl@0: */ sl@0: #define UCHAR_MAX 255U sl@0: sl@0: /** sl@0: Minimum and maximum values a `char' can hold. sl@0: The sign of "char" is probably dictated by a command-line switch to sl@0: your compiler. sl@0: MSVC will define _CHAR_UNSIGNED if the /J option is used. sl@0: GCC uses --unsigned-char (and friends) to override the default for sl@0: the target processor and defines a symbol __CHAR_UNSIGNED__ sl@0: if appropriate. sl@0: */ sl@0: #if defined(__CHAR_UNSIGNED__) || defined(_CHAR_UNSIGNED) || ( defined (__ARMCC__) && !( __FEATURE_SIGNED_CHAR) ) sl@0: #define CHAR_MIN 0 sl@0: #define CHAR_MAX UCHAR_MAX sl@0: #else sl@0: #define CHAR_MIN SCHAR_MIN sl@0: #define CHAR_MAX SCHAR_MAX sl@0: #endif sl@0: sl@0: /** sl@0: Minimum and maximum values a `signed short int' can hold. sl@0: */ sl@0: #define SHRT_MIN (-32768) sl@0: #define SHRT_MAX 32767 sl@0: sl@0: /** sl@0: Maximum value an `unsigned short int' can hold. (Minimum is 0.) sl@0: */ sl@0: #define USHRT_MAX 65535 sl@0: sl@0: /** sl@0: Minimum and maximum values a `signed int' can hold. sl@0: */ sl@0: #define INT_MIN (- INT_MAX - 1) sl@0: #define INT_MAX 2147483647 sl@0: sl@0: /** sl@0: Maximum value an `unsigned int' can hold. (Minimum is 0.) sl@0: */ sl@0: #define UINT_MAX 4294967295U sl@0: sl@0: /** sl@0: Minimum and maximum values a `signed long int' can hold. sl@0: */ sl@0: #define LONG_MIN INT_MIN sl@0: #define LONG_MAX INT_MAX sl@0: sl@0: /** sl@0: Maximum value an `unsigned long int' can hold. (Minimum is 0.) sl@0: */ sl@0: #define ULONG_MAX UINT_MAX sl@0: sl@0: #endif /* limits.h */