Blame lib/limits.in.h

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