freestnd-c-hdrs-0bsd/limits.h
2023-04-16 07:24:29 +02:00

54 lines
1.2 KiB
C

#if !defined(__FSTD_HDRS_LIMITS_H) || defined(__FSTD_HDRS_CXX_WRAP)
#if !defined(__FSTD_HDRS_CXX_WRAP)
#define __FSTD_HDRS_LIMITS_H 1
#endif
#ifndef __FSTD_HDRS_LIMITS_H_MACROS
#define __FSTD_HDRS_LIMITS_H_MACROS 1
#ifndef __FSTD_HDRS_C_JOIN
# define __FSTD_HDRS_C_EXPAND_JOIN(x, suffix) x ## suffix
# define __FSTD_HDRS_C_JOIN(x, suffix) __FSTD_HDRS_C_EXPAND_JOIN(x, suffix)
#endif
#define CHAR_BIT __CHAR_BIT__
#define MB_LEN_MAX 16
#define SCHAR_MAX __SCHAR_MAX__
#define SCHAR_MIN (-SCHAR_MAX - 1)
#define UCHAR_MAX (__FSTD_HDRS_C_JOIN(SCHAR_MAX, U) * 2 + 1)
#ifdef __CHAR_UNSIGNED__
# define CHAR_MAX UCHAR_MAX
# define CHAR_MIN 0
#else
# define CHAR_MAX SCHAR_MAX
# define CHAR_MIN SCHAR_MIN
#endif
#define SHRT_MAX __SHRT_MAX__
#define SHRT_MIN (-SHRT_MAX - 1)
#define USHRT_MAX (__FSTD_HDRS_C_JOIN(SHRT_MAX, U) * 2 + 1)
#define INT_MAX __INT_MAX__
#define INT_MIN (-INT_MAX - 1)
#define UINT_MAX (__FSTD_HDRS_C_JOIN(INT_MAX, U) * 2 + 1)
#define LONG_MAX __LONG_MAX__
#define LONG_MIN (-LONG_MAX - 1)
#define ULONG_MAX (__FSTD_HDRS_C_JOIN(LONG_MAX, U) * 2 + 1)
#define LLONG_MAX __LONG_LONG_MAX__
#define LLONG_MIN (-LLONG_MAX - 1)
#define ULLONG_MAX (__FSTD_HDRS_C_JOIN(LLONG_MAX, U) * 2 + 1)
#endif
#endif