os/ossrv/genericopenlibs/cstdlib/LINC/LIMITS.H
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 
    19 
    20 /**
    21  @file
    22  @publishedAll
    23  @released
    24 */
    25 
    26 #ifndef	_LIMITS_H_
    27 #define	_LIMITS_H_
    28 /**
    29 Number of bits in a `char'.	
    30 */
    31 #define	CHAR_BIT	8
    32 
    33 /**
    34 Maximum length of any multibyte character in any locale.
    35 Locale-writers should change this as necessary.  
    36 */
    37 #define	MB_LEN_MAX	2
    38 
    39 /**
    40 Minimum and maximum values a `signed char' can hold.  
    41 */
    42 #define	SCHAR_MIN	(-128)
    43 #define	SCHAR_MAX	127
    44 
    45 /**
    46 Maximum value an `unsigned char' can hold.  (Minimum is 0.)  
    47 */
    48 #define	UCHAR_MAX	255U
    49 
    50 /**
    51 Minimum and maximum values a `char' can hold.  
    52 The sign of "char" is probably dictated by a command-line switch to
    53 your compiler. 
    54 MSVC will define _CHAR_UNSIGNED if the /J option is used.
    55 GCC uses --unsigned-char (and friends) to override the default for
    56 the target processor and defines a symbol __CHAR_UNSIGNED__
    57 if appropriate.
    58 */
    59 #if defined(__CHAR_UNSIGNED__) || defined(_CHAR_UNSIGNED) || ( defined (__ARMCC__) && !( __FEATURE_SIGNED_CHAR) )
    60 #define	CHAR_MIN	0
    61 #define	CHAR_MAX	UCHAR_MAX
    62 #else
    63 #define	CHAR_MIN	SCHAR_MIN
    64 #define	CHAR_MAX	SCHAR_MAX
    65 #endif
    66 
    67 /**
    68 Minimum and maximum values a `signed short int' can hold.  
    69 */
    70 #define	SHRT_MIN	(-32768)
    71 #define	SHRT_MAX	32767
    72 
    73 /**
    74 Maximum value an `unsigned short int' can hold.  (Minimum is 0.)  
    75 */
    76 #define	USHRT_MAX	65535
    77 
    78 /**
    79 Minimum and maximum values a `signed int' can hold.  
    80 */
    81 #define	INT_MIN	(- INT_MAX - 1)
    82 #define	INT_MAX	2147483647
    83 
    84 /**
    85 Maximum value an `unsigned int' can hold.  (Minimum is 0.)  
    86 */
    87 #define	UINT_MAX	4294967295U
    88 
    89 /**
    90 Minimum and maximum values a `signed long int' can hold.  
    91 */
    92 #define	LONG_MIN	INT_MIN
    93 #define	LONG_MAX	INT_MAX
    94 
    95 /**
    96 Maximum value an `unsigned long int' can hold.  (Minimum is 0.)  
    97 */
    98 #define	ULONG_MAX	UINT_MAX
    99 
   100 #endif	/* limits.h  */