39 lines
977 B
C
39 lines
977 B
C
// Minimal limits.h for the W65816 runtime. Standalone (does not
|
|
// include the host clang's limits.h, which pulls in glibc headers
|
|
// and breaks the build). Sizes per the W65816 backend's view:
|
|
// char = 8 bits
|
|
// short = 16 bits
|
|
// int = 16 bits
|
|
// long = 32 bits
|
|
// long long = 64 bits
|
|
|
|
#ifndef _LIMITS_H
|
|
#define _LIMITS_H
|
|
|
|
#define CHAR_BIT 8
|
|
#define MB_LEN_MAX 1
|
|
|
|
#define SCHAR_MIN (-128)
|
|
#define SCHAR_MAX 127
|
|
#define UCHAR_MAX 255
|
|
// `char` is signed by default on this target.
|
|
#define CHAR_MIN SCHAR_MIN
|
|
#define CHAR_MAX SCHAR_MAX
|
|
|
|
#define SHRT_MIN (-32768)
|
|
#define SHRT_MAX 32767
|
|
#define USHRT_MAX 65535U
|
|
|
|
#define INT_MIN (-32768)
|
|
#define INT_MAX 32767
|
|
#define UINT_MAX 65535U
|
|
|
|
#define LONG_MIN (-2147483647L - 1)
|
|
#define LONG_MAX 2147483647L
|
|
#define ULONG_MAX 4294967295UL
|
|
|
|
#define LLONG_MIN (-9223372036854775807LL - 1)
|
|
#define LLONG_MAX 9223372036854775807LL
|
|
#define ULLONG_MAX 18446744073709551615ULL
|
|
|
|
#endif
|