summaryrefslogtreecommitdiff
path: root/nt/inc
diff options
context:
space:
mode:
authorChristoph Scholtes <cschol2112@gmail.com>2011-11-05 16:33:44 -0600
committerChristoph Scholtes <cschol2112@gmail.com>2011-11-05 16:33:44 -0600
commitc4c32b976a2b7b4e84c56fa2fff06e255b016372 (patch)
tree71b46ebdd188db3154a56a56ebcf69b7b7b36449 /nt/inc
parent226109108e955113828a46b1fe761a1164d1b12e (diff)
downloademacs-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/inc')
-rw-r--r--nt/inc/stdint.h26
1 files changed, 20 insertions, 6 deletions
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__ */