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)