OSDN Git Service

Correct mistyped __MINGW_NOTHROW macro.
[mingw/mingw-org-wsl.git] / include / limits.h
1 /**
2  * @file limits.h
3  * Copyright 2012, 2013 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 #ifndef _LIMITS_H
25 #define _LIMITS_H
26 #pragma GCC system_header
27 #include <_mingw.h>
28
29 /* 
30  * Functions for manipulating paths and directories (included from io.h)
31  * plus functions for setting the current drive.
32  *
33  * Defines constants for the sizes of integral types.
34  *
35  * NOTE: GCC should supply a version of this header and it should be safe to
36  *       use that version instead of this one (maybe safer).
37  */
38
39 /*
40  * File system limits
41  *
42  * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
43  *       same as FILENAME_MAX and FOPEN_MAX from stdio.h?
44  * NOTE: PATH_MAX is the POSIX equivalent for Microsoft's MAX_PATH; the two
45  *       are semantically identical, with a limit of 259 characters for the
46  *       path name, plus one for a terminating NUL, for a total of 260.
47  */
48 # define PATH_MAX       260
49
50 /*
51  * Characteristics of the char data type.
52  *
53  * TODO: Is MB_LEN_MAX correct?
54  */
55 #define CHAR_BIT        8
56 #define MB_LEN_MAX      2
57
58 #define SCHAR_MIN       (-128)
59 #define SCHAR_MAX       127
60
61 #define UCHAR_MAX       255
62
63 #ifndef _CHAR_UNSIGNED
64 #define CHAR_MIN        SCHAR_MIN
65 #define CHAR_MAX        SCHAR_MAX
66 #else
67 #define CHAR_MIN        0
68 #define CHAR_MAX        UCHAR_MAX
69 #endif
70
71 /*
72  * Maximum and minimum values for ints.
73  */
74 #define INT_MAX         2147483647
75 #define INT_MIN         (-INT_MAX-1)
76
77 #define UINT_MAX        0xffffffff
78
79 /*
80  * Maximum and minimum values for shorts.
81  */
82 #define SHRT_MAX        32767
83 #define SHRT_MIN        (-SHRT_MAX-1)
84
85 #define USHRT_MAX       0xffff
86
87 /*
88  * Maximum and minimum values for longs and unsigned longs.
89  */
90 #define LONG_MAX        2147483647L
91 #define LONG_MIN        (-LONG_MAX-1)
92 #define ULONG_MAX       0xffffffffUL
93
94 #define SSIZE_MAX LONG_MAX
95
96 #define LLONG_MAX 9223372036854775807LL
97 #define LLONG_MIN (-LLONG_MAX - 1)
98 #define ULLONG_MAX (2ULL * LLONG_MAX + 1)
99
100 #define LONG_LONG_MAX   9223372036854775807LL
101 #define LONG_LONG_MIN   (-LONG_LONG_MAX-1)
102 #define ULONG_LONG_MAX  (2ULL * LONG_LONG_MAX + 1)
103
104 /* MSVC compatibility */
105 #define _I64_MIN LONG_LONG_MIN
106 #define _I64_MAX LONG_LONG_MAX
107 #define _UI64_MAX ULONG_LONG_MAX
108
109 #endif /* not _LIMITS_H */