xref: /reactos/sdk/include/vcruntime/limits.h (revision abbc7840)
1 /**
2  * This file has no copyright assigned and is placed in the Public Domain.
3  * This file is part of the w64 mingw-runtime package.
4  * No warranty is given; refer to the file DISCLAIMER within this package.
5  */
6 #pragma once
7 #include <vcruntime.h>
8 
9 #ifndef _INC_LIMITS
10 #define _INC_LIMITS
11 
12 /*
13 * File system limits
14 *
15 * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
16 *       same as FILENAME_MAX and FOPEN_MAX from stdio.h?
17 * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
18 *       required for the NUL. TODO: Test?
19 */
20 #define PATH_MAX	(259)
21 
22 #define CHAR_BIT 8
23 #define SCHAR_MIN (-128)
24 #define SCHAR_MAX 127
25 #define UCHAR_MAX 0xff
26 
27 #ifdef _CHAR_UNSIGNED
28  #define CHAR_MIN 0
29  #define CHAR_MAX UCHAR_MAX
30 #else
31  #define CHAR_MIN SCHAR_MIN
32  #define CHAR_MAX SCHAR_MAX
33 #endif /* _CHAR_UNSIGNED */
34 
35 #define MB_LEN_MAX 5
36 #define SHRT_MIN (-32768)
37 #define SHRT_MAX 32767
38 #define USHRT_MAX 0xffff
39 #define INT_MIN (-2147483647 - 1)
40 #define INT_MAX 2147483647
41 #define UINT_MAX 0xffffffff
42 #define LONG_MIN (-2147483647L - 1)
43 #define LONG_MAX 2147483647L
44 #define ULONG_MAX 0xffffffffUL
45 #define LLONG_MAX 9223372036854775807LL
46 #define LLONG_MIN (-9223372036854775807LL - 1)
47 #define ULLONG_MAX 0xffffffffffffffffULL
48 
49 #define _I8_MIN ((signed char)(-127 - 1))
50 #define _I8_MAX ((signed char)127)
51 #define _UI8_MAX ((unsigned char)0xff)
52 
53 #define _I16_MIN ((short)(-32767 - 1))
54 #define _I16_MAX ((short)32767)
55 #define _UI16_MAX ((unsigned short)0xffffU)
56 
57 #define _I32_MIN (-2147483647 - 1)
58 #define _I32_MAX 2147483647
59 #define _UI32_MAX 0xffffffffu
60 
61 #define _I64_MIN (-9223372036854775807LL - 1)
62 #define _I64_MAX 9223372036854775807LL
63 #define _UI64_MAX 0xffffffffffffffffULL
64 
65 #if defined(_MSC_VER) && (_INTEGRAL_MAX_BITS >= 128)
66 #define _I128_MIN (-170141183460469231731687303715884105727i128 - 1)
67 #define _I128_MAX 170141183460469231731687303715884105727i128
68 #define _UI128_MAX 0xffffffffffffffffffffffffffffffffui128
69 #endif
70 
71 #ifndef SIZE_MAX
72 #ifdef _WIN64
73 #define SIZE_MAX _UI64_MAX
74 #else
75 #define SIZE_MAX UINT_MAX
76 #endif
77 #endif /* SIZE_MAX */
78 
79 #if __STDC_WANT_SECURE_LIB__
80 #ifndef RSIZE_MAX
81 #define RSIZE_MAX SIZE_MAX
82 #endif /* RSIZE_MAX */
83 #endif /* __STDC_WANT_SECURE_LIB__ */
84 
85 #endif /* _INC_LIMITS */
86