diff --git a/grub-core/lib/posix_wrap/limits.h b/grub-core/lib/posix_wrap/limits.h index 955295403..7217138ff 100644 --- a/grub-core/lib/posix_wrap/limits.h +++ b/grub-core/lib/posix_wrap/limits.h @@ -27,8 +27,14 @@ #define ULONG_MAX GRUB_ULONG_MAX #define SIZE_MAX GRUB_SIZE_MAX +#define SCHAR_MIN GRUB_SCHAR_MIN +#define SCHAR_MAX GRUB_SCHAR_MAX +#define SHRT_MIN GRUB_SHRT_MIN #define SHRT_MAX GRUB_SHRT_MAX +#define INT_MIN GRUB_INT_MIN #define INT_MAX GRUB_INT_MAX +#define LONG_MIN GRUB_LONG_MIN +#define LONG_MAX GRUB_LONG_MAX #define CHAR_BIT 8 diff --git a/include/grub/types.h b/include/grub/types.h index b93e48201..035a4b528 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -130,23 +130,26 @@ typedef grub_int32_t grub_ssize_t; # define PRIdGRUB_SSIZE "d" #endif +#define GRUB_SCHAR_MAX 127 +#define GRUB_SCHAR_MIN (-GRUB_SCHAR_MAX - 1) #define GRUB_UCHAR_MAX 0xFF #define GRUB_USHRT_MAX 65535 #define GRUB_SHRT_MAX 0x7fff +#define GRUB_SHRT_MIN (-GRUB_SHRT_MAX - 1) #define GRUB_UINT_MAX 4294967295U #define GRUB_INT_MAX 0x7fffffff -#define GRUB_INT32_MIN (-2147483647 - 1) +#define GRUB_INT_MIN (-GRUB_INT_MAX - 1) #define GRUB_INT32_MAX 2147483647 +#define GRUB_INT32_MIN (-GRUB_INT32_MAX - 1) #if GRUB_CPU_SIZEOF_LONG == 8 # define GRUB_ULONG_MAX 18446744073709551615UL # define GRUB_LONG_MAX 9223372036854775807L -# define GRUB_LONG_MIN (-9223372036854775807L - 1) #else # define GRUB_ULONG_MAX 4294967295UL # define GRUB_LONG_MAX 2147483647L -# define GRUB_LONG_MIN (-2147483647L - 1) #endif +# define GRUB_LONG_MIN (-GRUB_LONG_MAX - 1) typedef grub_uint64_t grub_properly_aligned_t;