GDBserver
limits.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A GNU-like <limits.h>.
3 
4  Copyright 2016 Free Software Foundation, Inc.
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  as published by the Free Software Foundation; either version 3, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, see <http://www.gnu.org/licenses/>. */
18 
19 #ifndef _GL_LIMITS_H
20 
21 #if __GNUC__ >= 3
22 #pragma GCC system_header
23 #endif
24 
25 
26 /* The include_next requires a split double-inclusion guard. */
27 #include_next <limits.h>
28 
29 #ifndef _GL_LIMITS_H
30 #define _GL_LIMITS_H
31 
32 /* The number of usable bits in an unsigned or signed integer type
33  with minimum value MIN and maximum value MAX, as an int expression
34  suitable in #if. Cover all known practical hosts. This
35  implementation exploits the fact that MAX is 1 less than a power of
36  2, and merely counts the number of 1 bits in MAX; "COBn" means
37  "count the number of 1 bits in the low-order n bits"). */
38 #define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
39 #define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
40 #define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
41 #define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
42 #define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
43 #define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
44 #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
45 
46 /* Macros specified by ISO/IEC TS 18661-1:2014. */
47 
48 #if (! defined ULLONG_WIDTH \
49  && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
50 # define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
51 # define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
52 # define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
53 # define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
54 # define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
55 # define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
56 # define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
57 # define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
58 # define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
59 # define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
60 # define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
61 #endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
62 
63 #endif /* _GL_LIMITS_H */
64 #endif /* _GL_LIMITS_H */