GBDK 2020 Docs API Documentation for GBDK 2020

limits.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2 limits.h - ANSI defines constants for sizes of integral types
3
4 Copyright (C) 1999, Sandeep Dutta . sandeep.dutta@usa.net
5
6 This library is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
9 later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this library; see the file COPYING. If not, write to the
18 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
19 MA 02110-1301, USA.
20
21 As a special exception, if you link this library with other files,
22 some of which are compiled with SDCC, to produce an executable,
23 this library does not by itself cause the resulting executable to
24 be covered by the GNU General Public License. This exception does
25 not however invalidate any other reasons why the executable file
26 might be covered by the GNU General Public License.
27 -------------------------------------------------------------------------*/
28
29 #ifndef __SDC51_LIMITS_H
30 #define __SDC51_LIMITS_H 1
31
32 #define CHAR_BIT 8 /* bits in a char */
33 #define SCHAR_MAX 127
34 #define SCHAR_MIN -128
35 #define UCHAR_MAX 0xff
36
37 #ifdef __SDCC_CHAR_UNSIGNED
38 #define CHAR_MAX UCHAR_MAX
39 #define CHAR_MIN 0
40 #else
41 #define CHAR_MAX SCHAR_MAX
42 #define CHAR_MIN SCHAR_MIN
43 #endif
44
45 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199409L
46 #define MB_LEN_MAX 4
47 #endif
48
49 #define INT_MIN (-32767 - 1)
50 #define INT_MAX 32767
51 #define SHRT_MAX INT_MAX
52 #define SHRT_MIN INT_MIN
53 #define UINT_MAX 0xffff
54 #define UINT_MIN 0
55 #define USHRT_MAX UINT_MAX
56 #define USHRT_MIN UINT_MIN
57 #define LONG_MIN (-2147483647L-1)
58 #define LONG_MAX 2147483647L
59 #define ULONG_MAX 0xffffffff
60 #define ULONG_MIN 0
61
62 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
63 #define LLONG_MIN (-9223372036854775807LL-1)
64 #define LLONG_MAX 9223372036854775807LL
65 #define ULLONG_MAX 18446744073709551615ULL
66 #endif
67
68 #endif
69