From c4c32b976a2b7b4e84c56fa2fff06e255b016372 Mon Sep 17 00:00:00 2001 From: Christoph Scholtes Date: Sat, 5 Nov 2011 16:33:44 -0600 Subject: [PATCH] * inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX) (UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX) (INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN) (intmax_t, INT64_MAX): Add for MSVC. --- nt/ChangeLog | 5 +++++ nt/inc/stdint.h | 26 ++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index 0d595657faf..fc612d64fa8 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,5 +1,10 @@ 2011-11-05 Christoph Scholtes + * inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX) + (UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX) + (INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN) + (intmax_t, INT64_MAX): Add for MSVC. + * config.nt: (mode_t) [!__GNUC__]: Define mode_t for MSVC. 2011-11-05 Eli Zaretskii diff --git a/nt/inc/stdint.h b/nt/inc/stdint.h index 4af0346af2c..5242a45df44 100644 --- a/nt/inc/stdint.h +++ b/nt/inc/stdint.h @@ -27,20 +27,34 @@ along with GNU Emacs. If not, see . */ /* Minimum definitions to allow compilation with tool chains where stdint.h is not available, e.g. Microsoft Visual Studio. */ -typedef unsigned int uint32_t; -#define INT32_MAX 2147483647 +#ifdef _WIN64 +typedef __int64 intptr_t; +#define UINT64_MAX 18446744073709551616 +#define UINT64_MIN 0 /* "i64" is the non-standard suffix used by MSVC for 64-bit constants. */ #define INT64_MAX 9223372036854775807i64 - -#ifdef _WIN64 - typedef __int64 intptr_t; +#define INT64_MIN (~INT64_MAX) #define INTPTR_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX +#define UINTMAX_MIN UINT64_MIN +#define INTMAX_MAX INT64_MAX +#define INTMAX_MIN INT64_MIN #else - typedef int intptr_t; +typedef int intptr_t; +typedef unsigned int uint32_t; +#define UINT32_MAX 4294967296 +#define UINT32_MIN 0 +#define INT32_MAX 2147483647 +#define INT32_MIN (~INT32_MAX) #define INTPTR_MAX INT32_MAX +#define UINTMAX_MAX UINT32_MAX +#define UINTMAX_MIN UINT32_MIN +#define INTMAX_MAX INT32_MAX +#define INTMAX_MIN INT32_MIN #endif #define uintmax_t unsigned __int64 +#define intmax_t __int64 #define PTRDIFF_MAX INTPTR_MAX #endif /* !__GNUC__ */ -- 2.39.2