diff options
author | Christoph Scholtes <cschol2112@gmail.com> | 2011-11-05 16:33:44 -0600 |
---|---|---|
committer | Christoph Scholtes <cschol2112@gmail.com> | 2011-11-05 16:33:44 -0600 |
commit | c4c32b976a2b7b4e84c56fa2fff06e255b016372 (patch) | |
tree | 71b46ebdd188db3154a56a56ebcf69b7b7b36449 /nt | |
parent | 226109108e955113828a46b1fe761a1164d1b12e (diff) | |
download | emacs-c4c32b976a2b7b4e84c56fa2fff06e255b016372.tar.gz |
* 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.
Diffstat (limited to 'nt')
-rw-r--r-- | nt/ChangeLog | 5 | ||||
-rw-r--r-- | 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 <cschol2112@googlemail.com> + * 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 <eliz@gnu.org> 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 <http://www.gnu.org/licenses/>. */ /* 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__ */ |