From ba3d664485a8c68e81ad07b3835995dc2d0e99ce Mon Sep 17 00:00:00 2001 From: mintsuki Date: Mon, 22 Jan 2024 23:22:44 +0100 Subject: [PATCH] options/ansi: Fix definitions of some limits.h macros --- options/ansi/include/limits.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/options/ansi/include/limits.h b/options/ansi/include/limits.h index 3d73f23a0d..9f4ad8cfca 100644 --- a/options/ansi/include/limits.h +++ b/options/ansi/include/limits.h @@ -21,11 +21,17 @@ # error "Unsupported configuration, please define either LONG_MAX or __LONG_MAX__" #endif +#undef INT_MIN #undef INT_MAX +#undef UINT_MAX +#undef LLONG_MIN #undef LLONG_MAX #undef ULLONG_MAX -#define INT_MIN (-INT_MAX - 1) + +#define INT_MIN (-__INT_MAX__ - 1) #define INT_MAX __INT_MAX__ +#define UINT_MAX (__INT_MAX__ * 2 + 1) + #define LLONG_MIN (-__LONG_LONG_MAX__ - 1LL) #define LLONG_MAX __LONG_LONG_MAX__ #define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)