1*fd82c4c4Schristos /* This file is automatically generated.  DO NOT EDIT! */
2*fd82c4c4Schristos /* Generated from: NetBSD: mknative-gdb,v 1.12 2020/09/17 16:54:31 christos Exp  */
3*fd82c4c4Schristos /* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
4*fd82c4c4Schristos 
5*fd82c4c4Schristos /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
6*fd82c4c4Schristos /* A GNU-like <limits.h>.
7*fd82c4c4Schristos 
8*fd82c4c4Schristos    Copyright 2016-2020 Free Software Foundation, Inc.
9*fd82c4c4Schristos 
10*fd82c4c4Schristos    This program is free software; you can redistribute it and/or
11*fd82c4c4Schristos    modify it under the terms of the GNU General Public License
12*fd82c4c4Schristos    as published by the Free Software Foundation; either version 3, or
13*fd82c4c4Schristos    (at your option) any later version.
14*fd82c4c4Schristos 
15*fd82c4c4Schristos    This program is distributed in the hope that it will be useful,
16*fd82c4c4Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
17*fd82c4c4Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*fd82c4c4Schristos    GNU General Public License for more details.
19*fd82c4c4Schristos 
20*fd82c4c4Schristos    You should have received a copy of the GNU General Public License
21*fd82c4c4Schristos    along with this program; if not, see <https://www.gnu.org/licenses/>.  */
22*fd82c4c4Schristos 
23*fd82c4c4Schristos #if __GNUC__ >= 3
24*fd82c4c4Schristos #pragma GCC system_header
25*fd82c4c4Schristos #endif
26*fd82c4c4Schristos 
27*fd82c4c4Schristos 
28*fd82c4c4Schristos #if defined _GL_ALREADY_INCLUDING_LIMITS_H
29*fd82c4c4Schristos /* Special invocation convention:
30*fd82c4c4Schristos    On Haiku/x86_64, we have a sequence of nested includes
31*fd82c4c4Schristos    <limits.h> -> <syslimits.h> -> <limits.h>.
32*fd82c4c4Schristos    In this situation, LONG_MAX and INT_MAX are not yet defined,
33*fd82c4c4Schristos    therefore we should not attempt to define LONG_BIT.  */
34*fd82c4c4Schristos 
35*fd82c4c4Schristos #include_next <limits.h>
36*fd82c4c4Schristos 
37*fd82c4c4Schristos #else
38*fd82c4c4Schristos /* Normal invocation convention.  */
39*fd82c4c4Schristos 
40*fd82c4c4Schristos #ifndef _GL_LIMITS_H
41*fd82c4c4Schristos 
42*fd82c4c4Schristos # define _GL_ALREADY_INCLUDING_LIMITS_H
43*fd82c4c4Schristos 
44*fd82c4c4Schristos /* The include_next requires a split double-inclusion guard.  */
45*fd82c4c4Schristos # include_next <limits.h>
46*fd82c4c4Schristos 
47*fd82c4c4Schristos # undef _GL_ALREADY_INCLUDING_LIMITS_H
48*fd82c4c4Schristos 
49*fd82c4c4Schristos #ifndef _GL_LIMITS_H
50*fd82c4c4Schristos #define _GL_LIMITS_H
51*fd82c4c4Schristos 
52*fd82c4c4Schristos #ifndef LLONG_MIN
53*fd82c4c4Schristos # if defined LONG_LONG_MIN /* HP-UX 11.31 */
54*fd82c4c4Schristos #  define LLONG_MIN LONG_LONG_MIN
55*fd82c4c4Schristos # elif defined LONGLONG_MIN /* IRIX 6.5 */
56*fd82c4c4Schristos #  define LLONG_MIN LONGLONG_MIN
57*fd82c4c4Schristos # elif defined __GNUC__
58*fd82c4c4Schristos #  define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL)
59*fd82c4c4Schristos # endif
60*fd82c4c4Schristos #endif
61*fd82c4c4Schristos #ifndef LLONG_MAX
62*fd82c4c4Schristos # if defined LONG_LONG_MAX /* HP-UX 11.31 */
63*fd82c4c4Schristos #  define LLONG_MAX LONG_LONG_MAX
64*fd82c4c4Schristos # elif defined LONGLONG_MAX /* IRIX 6.5 */
65*fd82c4c4Schristos #  define LLONG_MAX LONGLONG_MAX
66*fd82c4c4Schristos # elif defined __GNUC__
67*fd82c4c4Schristos #  define LLONG_MAX __LONG_LONG_MAX__
68*fd82c4c4Schristos # endif
69*fd82c4c4Schristos #endif
70*fd82c4c4Schristos #ifndef ULLONG_MAX
71*fd82c4c4Schristos # if defined ULONG_LONG_MAX /* HP-UX 11.31 */
72*fd82c4c4Schristos #  define ULLONG_MAX ULONG_LONG_MAX
73*fd82c4c4Schristos # elif defined ULONGLONG_MAX /* IRIX 6.5 */
74*fd82c4c4Schristos #  define ULLONG_MAX ULONGLONG_MAX
75*fd82c4c4Schristos # elif defined __GNUC__
76*fd82c4c4Schristos #  define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)
77*fd82c4c4Schristos # endif
78*fd82c4c4Schristos #endif
79*fd82c4c4Schristos 
80*fd82c4c4Schristos /* The number of usable bits in an unsigned or signed integer type
81*fd82c4c4Schristos    with minimum value MIN and maximum value MAX, as an int expression
82*fd82c4c4Schristos    suitable in #if.  Cover all known practical hosts.  This
83*fd82c4c4Schristos    implementation exploits the fact that MAX is 1 less than a power of
84*fd82c4c4Schristos    2, and merely counts the number of 1 bits in MAX; "COBn" means
85*fd82c4c4Schristos    "count the number of 1 bits in the low-order n bits").  */
86*fd82c4c4Schristos #define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
87*fd82c4c4Schristos #define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
88*fd82c4c4Schristos #define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
89*fd82c4c4Schristos #define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
90*fd82c4c4Schristos #define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
91*fd82c4c4Schristos #define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
92*fd82c4c4Schristos #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
93*fd82c4c4Schristos 
94*fd82c4c4Schristos #ifndef WORD_BIT
95*fd82c4c4Schristos /* Assume 'int' is 32 bits wide.  */
96*fd82c4c4Schristos # define WORD_BIT 32
97*fd82c4c4Schristos #endif
98*fd82c4c4Schristos #ifndef LONG_BIT
99*fd82c4c4Schristos /* Assume 'long' is 32 or 64 bits wide.  */
100*fd82c4c4Schristos # if LONG_MAX == INT_MAX
101*fd82c4c4Schristos #  define LONG_BIT 32
102*fd82c4c4Schristos # else
103*fd82c4c4Schristos #  define LONG_BIT 64
104*fd82c4c4Schristos # endif
105*fd82c4c4Schristos #endif
106*fd82c4c4Schristos 
107*fd82c4c4Schristos /* Macros specified by ISO/IEC TS 18661-1:2014.  */
108*fd82c4c4Schristos 
109*fd82c4c4Schristos #if (! defined ULLONG_WIDTH                                             \
110*fd82c4c4Schristos      && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
111*fd82c4c4Schristos # define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
112*fd82c4c4Schristos # define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
113*fd82c4c4Schristos # define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
114*fd82c4c4Schristos # define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
115*fd82c4c4Schristos # define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
116*fd82c4c4Schristos # define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
117*fd82c4c4Schristos # define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
118*fd82c4c4Schristos # define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
119*fd82c4c4Schristos # define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
120*fd82c4c4Schristos # define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
121*fd82c4c4Schristos # define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
122*fd82c4c4Schristos #endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
123*fd82c4c4Schristos 
124*fd82c4c4Schristos #endif /* _GL_LIMITS_H */
125*fd82c4c4Schristos #endif /* _GL_LIMITS_H */
126*fd82c4c4Schristos #endif
127