1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
7 // Sizes of integer types
8 // ----------------------------------------------------------------------------
11 #define __LIMITS_H __LIMITS_H
13 // ISO/IEC 9899:1999, ยง5.2.4.2.1
14 // The values given below shall be replaced by constant expressions suitable
15 // for use in #if preprocessing directives. Moreover, except for CHAR_BIT and
16 // MB_LEN_MAX, the following shall be replaced by expressions that have the
17 // same type as would an expression that is an object of the corresponding type
18 // converted according to the integer promotions. Their implementation-defined
19 // values shall be equal or greater in magnitude (absolute value) to those
20 // shown, with the same sign.
22 // This file is part of the platform personality (see personality.txt).
24 // Limits of type 'char'
26 #define CHAR_MAX // SCHAR_MAX / UCHAR_MAX
27 #define CHAR_MIN // SCHAR_MIN / 0
28 #define SCHAR_MAX // +127
29 #define SCHAR_MIN // -127
30 #define UCHAR_MAX // 255 (2^CHAR_BIT - 1)
32 // Multibyte characters
33 #define MB_LEN_MAX // 1
35 // Limits of type 'short int'
36 #define SHRT_MAX // +32767
37 #define SHRT_MIN // -32767
38 #define USHRT_MAX // 65535
40 // Limits of type 'int'
41 #define INT_MAX // +32767
42 #define INT_MIN // -32767
43 #define UINT_MAX // 65535
45 // Limits of type 'long int'
46 #define LONG_MAX // +2147483647
47 #define LONG_MIN // -2147483647
48 #define ULONG_MAX // 4294967295
50 // Limits of type 'long long int'
51 #define LLONG_MAX // +9223372036854775807
52 #define LLONG_MIN // -9223372036854775807
53 #define ULLONG_MAX // 18446744073709551615