From 1d13a6090186938a21aeb09c26c383f370c749eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sun, 14 Dec 2014 15:43:04 +0100 Subject: [PATCH] stdint.h: define [U]INT64[MAX|MIN] with [U]L on x86_64 instead of [U]LL --- headers/posix/stdint.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/headers/posix/stdint.h b/headers/posix/stdint.h index 6baebcdc55..03e66957bc 100644 --- a/headers/posix/stdint.h +++ b/headers/posix/stdint.h @@ -69,9 +69,14 @@ typedef uint64_t uintmax_t; #define INT32_MIN (-INT32_MAX-1) #define UINT32_MAX (4294967295U) -#define INT64_MAX (9223372036854775807LL) -#define INT64_MIN (-INT64_MAX-1) +#if defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ > 4 +#define INT64_MAX (9223372036854775807UL) +#define UINT64_MAX (18446744073709551615UL) +#else +#define INT64_MAX (9223372036854775807ULL) #define UINT64_MAX (18446744073709551615ULL) +#endif +#define INT64_MIN (-INT64_MAX-1) /* Limits of minimum-width integer types */ #define INT_LEAST8_MIN INT8_MIN