roken: stdint.hin libtommath 1.2.0 needs more

libtommath 1.2.0 c403b66082
("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
This commit is contained in:
Jeffrey Altman
2020-05-25 14:08:45 -04:00
committed by Nicolas Williams
parent afc9ebe08b
commit f77618ef15

View File

@@ -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 <intsafe.h>
#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
}