chromium/third_party/llvm-build/Release+Asserts/lib/clang/20/include/limits.h

/*===---- limits.h - Standard header for integer sizes --------------------===*\
 *
 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 * See https://llvm.org/LICENSE.txt for license information.
 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 *
\*===----------------------------------------------------------------------===*/

#ifndef __CLANG_LIMITS_H
#define __CLANG_LIMITS_H

#if defined(__MVS__) && __has_include_next(<limits.h>)
#include_next <limits.h>
#else

/* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
   Avert this #include_next madness. */
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
#define _GCC_LIMITS_H_
#endif

/* System headers include a number of constants from POSIX in <limits.h>.
   Include it if we're hosted. */
#if __STDC_HOSTED__ && __has_include_next(<limits.h>)
#include_next <limits.h>
#endif

/* Many system headers try to "help us out" by defining these.  No really, we
   know how big each datatype is. */
#undef  SCHAR_MIN
#undef  SCHAR_MAX
#undef  UCHAR_MAX
#undef  SHRT_MIN
#undef  SHRT_MAX
#undef  USHRT_MAX
#undef  INT_MIN
#undef  INT_MAX
#undef  UINT_MAX
#undef  LONG_MIN
#undef  LONG_MAX
#undef  ULONG_MAX

#undef  CHAR_BIT
#undef  CHAR_MIN
#undef  CHAR_MAX

/* C90/99 5.2.4.2.1 */
#define SCHAR_MAX
#define SHRT_MAX
#define INT_MAX
#define LONG_MAX

#define SCHAR_MIN
#define SHRT_MIN
#define INT_MIN
#define LONG_MIN

#define UCHAR_MAX
#if __SHRT_WIDTH__ < __INT_WIDTH__
#define USHRT_MAX
#else
#define USHRT_MAX
#endif
#define UINT_MAX
#define ULONG_MAX

#ifndef MB_LEN_MAX
#define MB_LEN_MAX
#endif

#define CHAR_BIT

/* C23 5.2.4.2.1 */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
#define BOOL_WIDTH
#define CHAR_WIDTH
#define SCHAR_WIDTH
#define UCHAR_WIDTH
#define USHRT_WIDTH
#define SHRT_WIDTH
#define UINT_WIDTH
#define INT_WIDTH
#define ULONG_WIDTH
#define LONG_WIDTH
#define ULLONG_WIDTH
#define LLONG_WIDTH

#define BITINT_MAXWIDTH
#endif

#ifdef __CHAR_UNSIGNED__  /* -funsigned-char */
#define CHAR_MIN
#define CHAR_MAX
#else
#define CHAR_MIN
#define CHAR_MAX
#endif

/* C99 5.2.4.2.1: Added long long.
   C++11 18.3.3.2: same contents as the Standard C Library header <limits.h>.
 */
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) ||              \
    (defined(__cplusplus) && __cplusplus >= 201103L)

#undef  LLONG_MIN
#undef  LLONG_MAX
#undef  ULLONG_MAX

#define LLONG_MAX
#define LLONG_MIN
#define ULLONG_MAX
#endif

/* LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX are a GNU extension.  It's too bad
   that we don't have something like #pragma poison that could be used to
   deprecate a macro - the code should just use LLONG_MAX and friends.
 */
#if defined(__GNU_LIBRARY__) ? defined(__USE_GNU) : !defined(__STRICT_ANSI__)

#undef   LONG_LONG_MIN
#undef   LONG_LONG_MAX
#undef   ULONG_LONG_MAX

#define LONG_LONG_MAX
#define LONG_LONG_MIN
#define ULONG_LONG_MAX
#endif

#endif /* __MVS__ */
#endif /* __CLANG_LIMITS_H */