* src/SDCCval.c, src/SDCCmain.c, device/include/limits.h,
[fw/sdcc] / device / include / pic16 / limits.h
1 /*-------------------------------------------------------------------------
2   limits.h - ANSI defines constants for sizes of integral types
3
4         Adopted for the pic16 port by Vangelis Rokas
5                 [ vrokas at otenet.gr ] 2004
6
7              Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
8
9    This program is free software; you can redistribute it and/or modify it
10    under the terms of the GNU General Public License as published by the
11    Free Software Foundation; either version 2, or (at your option) any
12    later version.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23    In other words, you are welcome to use, share and improve this program.
24    You are forbidden to forbid anyone else to use, share and improve
25    what you give them.   Help stamp out software-hoarding!
26 -------------------------------------------------------------------------*/
27
28 #ifndef __LIMITS_H
29 #define __LIMITS_H 1
30
31 #define CHAR_BIT      8    /* bits in a char */
32 #define SCHAR_MAX   127
33 #define SCHAR_MIN  -128
34 #define UCHAR_MAX   0xff
35 #define UCHAR_MIN   0
36 #ifdef SDCC_CHAR_UNSIGNED
37 #define CHAR_MAX    UCHAR_MAX
38 #define CHAR_MIN    UCHAR_MIN
39 #else
40 #define CHAR_MAX    SCHAR_MAX
41 #define CHAR_MIN    SCHAR_MIN
42 #endif
43 #define INT_MIN    -32768
44 #define INT_MAX     32767
45 #define SHRT_MAX    INT_MAX
46 #define SHRT_MIN    INT_MIN
47 #define UINT_MAX    0xffff
48 #define UINT_MIN    0
49 #define USHRT_MAX   UINT_MAX
50 #define USHRT_MIN   UINT_MIN
51 #define LONG_MIN   -2147483648
52 #define LONG_MAX    2147483647
53 #define ULONG_MAX   0xffffffff
54 #define ULONG_MIN   0
55
56 #endif