Blame lib/limits.in.h

Packit Service a2489d
/* A GNU-like <limits.h>.
Packit Service a2489d
Packit Service a2489d
   Copyright 2016-2018 Free Software Foundation, Inc.
Packit Service a2489d
Packit Service a2489d
   This program is free software; you can redistribute it and/or
Packit Service a2489d
   modify it under the terms of the GNU General Public License
Packit Service a2489d
   as published by the Free Software Foundation; either version 3, or
Packit Service a2489d
   (at your option) any later version.
Packit Service a2489d
Packit Service a2489d
   This program is distributed in the hope that it will be useful,
Packit Service a2489d
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a2489d
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service a2489d
   GNU General Public License for more details.
Packit Service a2489d
Packit Service a2489d
   You should have received a copy of the GNU General Public License
Packit Service a2489d
   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
Packit Service a2489d
Packit Service a2489d
#ifndef _@GUARD_PREFIX@_LIMITS_H
Packit Service a2489d
Packit Service a2489d
#if __GNUC__ >= 3
Packit Service a2489d
@PRAGMA_SYSTEM_HEADER@
Packit Service a2489d
#endif
Packit Service a2489d
@PRAGMA_COLUMNS@
Packit Service a2489d
Packit Service a2489d
/* The include_next requires a split double-inclusion guard.  */
Packit Service a2489d
#@INCLUDE_NEXT@ @NEXT_LIMITS_H@
Packit Service a2489d
Packit Service a2489d
#ifndef _@GUARD_PREFIX@_LIMITS_H
Packit Service a2489d
#define _@GUARD_PREFIX@_LIMITS_H
Packit Service a2489d
Packit Service a2489d
/* For HP-UX 11.31.  */
Packit Service a2489d
#if defined LONG_LONG_MIN && !defined LLONG_MIN
Packit Service a2489d
# define LLONG_MIN LONG_LONG_MIN
Packit Service a2489d
#endif
Packit Service a2489d
#if defined LONG_LONG_MAX && !defined LLONG_MAX
Packit Service a2489d
# define LLONG_MAX LONG_LONG_MAX
Packit Service a2489d
#endif
Packit Service a2489d
#if defined ULONG_LONG_MAX && !defined ULLONG_MAX
Packit Service a2489d
# define ULLONG_MAX ULONG_LONG_MAX
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* The number of usable bits in an unsigned or signed integer type
Packit Service a2489d
   with minimum value MIN and maximum value MAX, as an int expression
Packit Service a2489d
   suitable in #if.  Cover all known practical hosts.  This
Packit Service a2489d
   implementation exploits the fact that MAX is 1 less than a power of
Packit Service a2489d
   2, and merely counts the number of 1 bits in MAX; "COBn" means
Packit Service a2489d
   "count the number of 1 bits in the low-order n bits").  */
Packit Service a2489d
#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
Packit Service a2489d
#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
Packit Service a2489d
#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
Packit Service a2489d
#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
Packit Service a2489d
#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
Packit Service a2489d
#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
Packit Service a2489d
#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
Packit Service a2489d
Packit Service a2489d
/* Macros specified by ISO/IEC TS 18661-1:2014.  */
Packit Service a2489d
Packit Service a2489d
#if (! defined ULLONG_WIDTH                                             \
Packit Service a2489d
     && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
Packit Service a2489d
# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
Packit Service a2489d
# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
Packit Service a2489d
# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
Packit Service a2489d
# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
Packit Service a2489d
# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
Packit Service a2489d
# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
Packit Service a2489d
# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
Packit Service a2489d
# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
Packit Service a2489d
# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
Packit Service a2489d
# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
Packit Service a2489d
# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
Packit Service a2489d
#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
Packit Service a2489d
Packit Service a2489d
#endif /* _@GUARD_PREFIX@_LIMITS_H */
Packit Service a2489d
#endif /* _@GUARD_PREFIX@_LIMITS_H */