1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:17:36 +00:00

LibC: Make <limits.h> compatible with GCC so that it doesn't install a fixed header

GCC installs a fixed version of the <limits.h> header as per https://gcc.gnu.org/onlinedocs/gcc/Fixed-Headers.html.
The fixed header doesn't include the target's <limits.h> which in turn means that some definitions (such as PATH_MAX)
aren't available. This change requires rebuilding the toolchain (Toolchain/BuildIt.sh).

This fixes the flatbuffers port.

The commit also removes some non-standard defines (U*_MIN) which don't appear to be used
anywhere. By definition they're always 0 though so they're not strictly necessary.
This commit is contained in:
Gunnar Beutner 2021-04-11 05:10:35 +02:00 committed by Andreas Kling
parent dc446920e0
commit be4b20c14d
2 changed files with 24 additions and 2 deletions

View file

@ -74,7 +74,6 @@ typedef __INTPTR_TYPE__ intptr_t;
typedef __UINTMAX_TYPE__ uintmax_t;
#define UINTMAX_MAX __UINTMAX_MAX__
#define UINTMAX_MIN __UINTMAX_MIN__
typedef __INTMAX_TYPE__ intmax_t;
#define INTMAX_MAX __INTMAX_MAX__

View file

@ -47,13 +47,17 @@
#define INT_MIN INT32_MIN
#define UINT_MAX UINT32_MAX
#define UINT_MIN UINT32_MIN
#define CHAR_BIT 8
#define SCHAR_MIN (-128)
#define SCHAR_MAX 127
#define UCHAR_MAX 255
#define SHRT_MAX 32768
#define SHRT_MIN (-SHRT_MAX - 1)
#define USHRT_MAX 65535
#define LONG_MAX 2147483647L
#define LONG_MIN (-LONG_MAX - 1L)
@ -62,11 +66,30 @@
#define LONG_LONG_MAX 9223372036854775807LL
#define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
#define LLONG_MAX LONG_LONG_MAX
#define LLONG_MIN LONG_LONG_MIN
#define ULONG_LONG_MAX 18446744073709551615ULL
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
#define CHAR_WIDTH 8
#define SCHAR_WIDTH 8
#define UCHAR_WIDTH 8
#define SHRT_WIDTH 16
#define USHRT_WIDTH 16
#define INT_WIDTH 32
#define UINT_WIDTH 32
#define LONG_WIDTH 32
#define ULONG_WIDTH 32
#define LLONG_WIDTH 64
#define ULLONG_WIDTH 64
#define MB_LEN_MAX 16
#define ARG_MAX 65536