diff options
| -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 @@ | |||
| 1 | 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com> | 1 | 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com> |
| 2 | 2 | ||
| 3 | * inc/stdint.h (UINT64_MAX, UINT64_MIN, INT64_MIN, UINTMAX_MAX) | ||
| 4 | (UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN, UINT32_MIN, UINT32_MAX) | ||
| 5 | (INT32_MIN, UINTMAX_MAX, UINTMAX_MIN, INTMAX_MAX, INTMAX_MIN) | ||
| 6 | (intmax_t, INT64_MAX): Add for MSVC. | ||
| 7 | |||
| 3 | * config.nt: (mode_t) [!__GNUC__]: Define mode_t for MSVC. | 8 | * config.nt: (mode_t) [!__GNUC__]: Define mode_t for MSVC. |
| 4 | 9 | ||
| 5 | 2011-11-05 Eli Zaretskii <eliz@gnu.org> | 10 | 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/>. */ | |||
| 27 | /* Minimum definitions to allow compilation with tool chains where | 27 | /* Minimum definitions to allow compilation with tool chains where |
| 28 | stdint.h is not available, e.g. Microsoft Visual Studio. */ | 28 | stdint.h is not available, e.g. Microsoft Visual Studio. */ |
| 29 | 29 | ||
| 30 | typedef unsigned int uint32_t; | 30 | #ifdef _WIN64 |
| 31 | #define INT32_MAX 2147483647 | 31 | typedef __int64 intptr_t; |
| 32 | #define UINT64_MAX 18446744073709551616 | ||
| 33 | #define UINT64_MIN 0 | ||
| 32 | /* "i64" is the non-standard suffix used by MSVC for 64-bit constants. */ | 34 | /* "i64" is the non-standard suffix used by MSVC for 64-bit constants. */ |
| 33 | #define INT64_MAX 9223372036854775807i64 | 35 | #define INT64_MAX 9223372036854775807i64 |
| 34 | 36 | #define INT64_MIN (~INT64_MAX) | |
| 35 | #ifdef _WIN64 | ||
| 36 | typedef __int64 intptr_t; | ||
| 37 | #define INTPTR_MAX INT64_MAX | 37 | #define INTPTR_MAX INT64_MAX |
| 38 | #define UINTMAX_MAX UINT64_MAX | ||
| 39 | #define UINTMAX_MIN UINT64_MIN | ||
| 40 | #define INTMAX_MAX INT64_MAX | ||
| 41 | #define INTMAX_MIN INT64_MIN | ||
| 38 | #else | 42 | #else |
| 39 | typedef int intptr_t; | 43 | typedef int intptr_t; |
| 44 | typedef unsigned int uint32_t; | ||
| 45 | #define UINT32_MAX 4294967296 | ||
| 46 | #define UINT32_MIN 0 | ||
| 47 | #define INT32_MAX 2147483647 | ||
| 48 | #define INT32_MIN (~INT32_MAX) | ||
| 40 | #define INTPTR_MAX INT32_MAX | 49 | #define INTPTR_MAX INT32_MAX |
| 50 | #define UINTMAX_MAX UINT32_MAX | ||
| 51 | #define UINTMAX_MIN UINT32_MIN | ||
| 52 | #define INTMAX_MAX INT32_MAX | ||
| 53 | #define INTMAX_MIN INT32_MIN | ||
| 41 | #endif | 54 | #endif |
| 42 | 55 | ||
| 43 | #define uintmax_t unsigned __int64 | 56 | #define uintmax_t unsigned __int64 |
| 57 | #define intmax_t __int64 | ||
| 44 | #define PTRDIFF_MAX INTPTR_MAX | 58 | #define PTRDIFF_MAX INTPTR_MAX |
| 45 | 59 | ||
| 46 | #endif /* !__GNUC__ */ | 60 | #endif /* !__GNUC__ */ |