Blame gl/limits.in.h

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