update copyright
[AROS.git] / compiler / stdc / include / aros / stdc / limits.h
blob909d6a90522ef36209c5c41ed6f709eca6bed8b5
1 /*
2 * Copyright © 2004-2015 The AROS Developmemt Team. All rights reserved.
3 * $Id$
5 * C99 header file limits.h
6 */
8 #ifndef _STDC_LIMITS_H_
9 #define _STDC_LIMITS_H_
11 #ifdef __cplusplus
12 #define __STDC_LIMIT_MACROS
13 #endif
14 #include <stdint.h>
16 /* Sizes of integer types <limits.h> */
19 * Define ANSI <limits.h> for standard 32-bit words.
20 * We're assuming
21 * 8-bit 'char',
22 * 16-bit 'short int', and
23 * 32-bit 'int' and 'long int'.
26 /* FIXME: Are all these values 64 bit OK ? */
28 /* Number of bits for smallest object that is not a bit-field (byte) */
29 #define CHAR_BIT 8
30 /* minimum value for an object of type signed char */
31 #define SCHAR_MIN INT8_MIN
32 /* maximum value for an object of type signed char */
33 #define SCHAR_MAX INT8_MAX
34 /* maximum value for an object of type unsigned char */
35 #define UCHAR_MAX UINT8_MAX
36 /* minimum value for an object of type char */
37 #define CHAR_MIN SCHAR_MIN
38 /* maximum value for an object of type char */
39 #define CHAR_MAX SCHAR_MAX
40 /* maximum number of bytes in a multibyte character, for any supported locale */
41 #define MB_LEN_MAX 1 /* At the moment only "C" locale supported */
42 /* minimum value for an object of type short int */
43 #define SHRT_MIN INT16_MIN
44 /* maximum value for an object of type short int */
45 #define SHRT_MAX INT16_MAX
46 /* maximum value for an object of type unsigned short int */
47 #define USHRT_MAX UINT16_MAX
48 /* minimum value for an object of type int */
49 #define INT_MIN INT32_MIN
50 /* maximum value for an object of type int */
51 #define INT_MAX INT32_MAX
52 /* maximum value for an object of type unsigned int */
53 #define UINT_MAX UINT32_MAX
54 /* minimum value for an object of type long int */
55 #define LONG_MIN (-LONG_MAX - 1L)
56 /* maximum value for an object of type long int */
57 #if __WORDSIZE == 64
58 # define LONG_MAX INT64_MAX
59 #else
60 # define LONG_MAX INT32_MAX
61 #endif
62 /* maximum value for an object of type unsigned long int */
63 #if __WORDSIZE == 64
64 # define ULONG_MAX UINT64_MAX
65 #else
66 # define ULONG_MAX UINT32_MAX
67 #endif
68 /* minimum value for an object of type long long int */
69 #define LLONG_MIN (-0x7fffffffffffffffLL - 1)
70 /* maximum value for an object of type long long int */
71 #define LLONG_MAX 0x7fffffffffffffffLL
72 /* maximum value for an object of type unsigned long long int */
73 #define ULLONG_MAX 0xffffffffffffffffULL
75 #endif /* _STDC_LIMITS_H_ */