From f77618ef15d37b7abea2d17c00bd4aa8f2406fef Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 25 May 2020 14:08:45 -0400 Subject: [PATCH] roken: stdint.hin libtommath 1.2.0 needs more libtommath 1.2.0 c403b660825f0f99451a805408f6a8ef354d1cd7 ("hcrypto: import libtommath v1.2.0") needs more from stdint.h than what Heimdal previously declared. Add more integer type declarations and integer MIN/MAX macros. Also, on Windows declare 64-bit integers using __int64 as "long long" is not supported as 64-bit type across all visual studio compiler versions. Change-Id: I944bedc67bcb26374ffb30eb3dfd7c6108a98fc3 --- lib/roken/stdint.hin | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/roken/stdint.hin b/lib/roken/stdint.hin index 4a8387a4e..e552d9dc6 100644 --- a/lib/roken/stdint.hin +++ b/lib/roken/stdint.hin @@ -5,8 +5,36 @@ extern "C" { #endif +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int int16_t; +typedef unsigned short int uint16_t; +typedef int int32_t; +typedef unsigned int uint32_t; +#ifdef _MSC_VER +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else typedef long long int64_t; typedef unsigned long long uint64_t; +#endif + +#ifdef _MSC_VER +#include +#else +#define INT8_MAX 0x7F +#define INT8_MIN (-INT8_MAX - 1) +#define UINT8_MAX 0xFF +#define INT16_MAX 0x7FFF +#define INT16_MIN (-INT16_MAX - 1) +#define UINT16_MAX 0xFFFF +#define INT32_MAX 0x7FFFFFFF +#define INT32_MIN (-INT32_MIN - 1) +#define UINT32_MAX 0xFFFFFFFF +#define INT64_MAX 0x7FFFFFFFFFFFFFFFLL +#define INT64_MIN (-INT64_MAX - 1) +#define UINT64_MAX 0xFFFFFFFFFFFFFFFFLL +#endif #ifdef __cplusplus }