freestanding-headers/limits.h

54 lines
1.1 KiB
C
Raw Normal View History

2023-03-23 21:24:51 +03:00
#if !defined(_LIMITS_H) || defined(__LIBC_CXX_WRAP)
#if !defined(__LIBC_CXX_WRAP)
2023-03-16 01:08:11 +03:00
#define _LIMITS_H 1
#endif
2023-03-16 00:50:24 +03:00
2023-03-16 01:08:11 +03:00
#ifndef __LIMITS_H_MACROS
#define __LIMITS_H_MACROS 1
2023-02-18 11:28:14 +03:00
2023-02-18 14:56:32 +03:00
#ifndef __LIBC_C_JOIN
# define __LIBC_C_EXPAND_JOIN(x, suffix) x ## suffix
# define __LIBC_C_JOIN(x, suffix) __LIBC_C_EXPAND_JOIN(x, suffix)
#endif
2023-02-18 11:28:14 +03:00
#define CHAR_BIT __CHAR_BIT__
2023-03-16 00:50:24 +03:00
#define MB_LEN_MAX 16
2023-02-18 11:28:14 +03:00
#define SCHAR_MAX __SCHAR_MAX__
#define SCHAR_MIN (-SCHAR_MAX - 1)
2023-02-18 14:56:32 +03:00
#define UCHAR_MAX (__LIBC_C_JOIN(SCHAR_MAX, U) * 2 + 1)
2023-02-18 11:28:14 +03:00
2023-02-18 14:56:32 +03:00
#ifdef __CHAR_UNSIGNED__
# define CHAR_MAX UCHAR_MAX
# define CHAR_MIN 0
#else
# define CHAR_MAX SCHAR_MAX
# define CHAR_MIN SCHAR_MIN
#endif
2023-02-18 11:28:14 +03:00
#define SHRT_MAX __SHRT_MAX__
#define SHRT_MIN (-SHRT_MAX - 1)
2023-02-18 14:56:32 +03:00
#define USHRT_MAX (__LIBC_C_JOIN(SHRT_MAX, U) * 2 + 1)
2023-02-18 11:28:14 +03:00
#define INT_MAX __INT_MAX__
#define INT_MIN (-INT_MAX - 1)
2023-02-18 14:56:32 +03:00
#define UINT_MAX (__LIBC_C_JOIN(INT_MAX, U) * 2 + 1)
2023-02-18 11:28:14 +03:00
#define LONG_MAX __LONG_MAX__
#define LONG_MIN (-LONG_MAX - 1)
2023-02-18 14:56:32 +03:00
#define ULONG_MAX (__LIBC_C_JOIN(LONG_MAX, U) * 2 + 1)
2023-02-18 11:28:14 +03:00
#define LLONG_MAX __LONG_LONG_MAX__
#define LLONG_MIN (-LLONG_MAX - 1)
2023-02-18 14:56:32 +03:00
#define ULLONG_MAX (__LIBC_C_JOIN(LLONG_MAX, U) * 2 + 1)
2023-02-18 11:28:14 +03:00
#endif
2023-03-16 00:50:24 +03:00
#endif