From 23a8b2c303f7329b29c7d9eb0604b056f66c75a4 Mon Sep 17 00:00:00 2001 From: Tevo Date: Thu, 3 Sep 2020 00:06:31 -0300 Subject: [PATCH] Define integer size macros for lacking systems Define integer size macros for lacking systems --- src/common/inttypes.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/inttypes.h b/src/common/inttypes.h index 29ac778ef..a36543e63 100644 --- a/src/common/inttypes.h +++ b/src/common/inttypes.h @@ -57,6 +57,16 @@ typedef size_t uintptr_t; typedef ptrdiff_t intmax_t; typedef size_t uintmax_t; +#define INT8_MAX (0x7F) +#define INT16_MAX (0x7FFF) +#define INT32_MAX (0x7FFFFFFF) + +#define INT8_MIN (-INT8_MAX - 1) +#define INT16_MIN (-INT16_MAX - 1) + +#define UINT8_MAX (0xFF) +#define UINT16_MAX (0xFFFF) + #endif