File: limits.h

package info (click to toggle)
smallerc 1.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,692 kB
  • sloc: ansic: 48,651; asm: 2,897; makefile: 46; sh: 6
file content (43 lines) | stat: -rw-r--r-- 753 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
  Copyright (c) 2014, Alexey Frunze
  2-clause BSD license.
*/
#ifndef __LIMITS_H
#define __LIMITS_H

#define CHAR_BIT 8

#ifdef __SMALLER_C_SCHAR__
#define CHAR_MIN (-128)
#define CHAR_MAX 127
#endif

#ifdef __SMALLER_C_UCHAR__
#define CHAR_MIN 0
#define CHAR_MAX 255
#endif

#define SCHAR_MIN (-128)
#define SCHAR_MAX 127
#define UCHAR_MAX 255

#define SHRT_MIN (-32767-1)
#define SHRT_MAX 32767
#define USHRT_MAX 0xFFFF

#ifdef __SMALLER_C_16__
#define INT_MIN (-32767-1)
#define INT_MAX 32767
#define UINT_MAX 65535U
#endif

#ifdef __SMALLER_C_32__
#define INT_MIN (-2147483647-1)
#define INT_MAX 2147483647
#define UINT_MAX 4294967295U
#define LONG_MIN (-2147483647L-1)
#define LONG_MAX 2147483647L
#define ULONG_MAX 4294967295UL
#endif

#endif