diff options
Diffstat (limited to 'src/include/c.h')
-rw-r--r-- | src/include/c.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/include/c.h b/src/include/c.h index 744721860c..e7ee5105a2 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -249,6 +249,36 @@ typedef uint8 bits8; /* >= 8 bits */ typedef uint16 bits16; /* >= 16 bits */ typedef uint32 bits32; /* >= 32 bits */ +/* should be defined in stdint.h, but we guarantee them here */ +#ifndef INT8_MIN +#define INT8_MIN (-0x7F-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (0x7F) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-0x7FFF-1) +#endif +#ifndef INT16_MAX +#define INT16_MAX (0x7FFF) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-0x7FFFFFFF-1) +#endif +#ifndef INT32_MAX +#define INT32_MAX (0x7FFFFFFF) +#endif + +#ifndef UINT8_MAX +#define UINT8_MAX (0xFF) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (0xFFFF) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (0xFFFFFFFF) +#endif + /* * 64-bit integers */ @@ -284,6 +314,17 @@ typedef unsigned long long int uint64; #define UINT64CONST(x) ((uint64) x) #endif +/* should be defined in stdint.h, but we guarantee them here */ +#ifndef INT64_MIN +#define INT64_MIN (-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1) +#endif +#ifndef INT64_MAX +#define INT64_MAX INT64CONST(0x7FFFFFFFFFFFFFFF) +#endif +#ifndef UINT64_MAX +#define UINT64_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF) +#endif + /* snprintf format strings to use for 64-bit integers */ #define INT64_FORMAT "%" INT64_MODIFIER "d" #define UINT64_FORMAT "%" INT64_MODIFIER "u" |