aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTijl Coosemans <tijl@FreeBSD.org>2012-03-04 20:02:20 +0000
committerTijl Coosemans <tijl@FreeBSD.org>2012-03-04 20:02:20 +0000
commit21d0ce786838f9ea6ca4bf455969c804c7d39397 (patch)
tree9417dd027a77ca9b55a68640d2f8d38d8c137e48
parentaa15e881bb453670d9155ace6c4b1885b15056e1 (diff)
Do not use INT64_C and UINT64_C to define 64 bit integer limits. They
aren't defined for C++ code unless __STDC_CONSTANT_MACROS is defined. Reported by: jhb
Notes
Notes: svn path=/head/; revision=232519
-rw-r--r--sys/x86/include/_stdint.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/x86/include/_stdint.h b/sys/x86/include/_stdint.h
index a1a56c5fbeac..a9d403705f00 100644
--- a/sys/x86/include/_stdint.h
+++ b/sys/x86/include/_stdint.h
@@ -69,23 +69,27 @@
* ISO/IEC 9899:1999
* 7.18.2.1 Limits of exact-width integer types
*/
-/* Minimum values of exact-width signed integer types. */
#define INT8_MIN (-0x7f-1)
#define INT16_MIN (-0x7fff-1)
#define INT32_MIN (-0x7fffffff-1)
-#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-1)
-/* Maximum values of exact-width signed integer types. */
#define INT8_MAX 0x7f
#define INT16_MAX 0x7fff
#define INT32_MAX 0x7fffffff
-#define INT64_MAX INT64_C(0x7fffffffffffffff)
-/* Maximum values of exact-width unsigned integer types. */
#define UINT8_MAX 0xff
#define UINT16_MAX 0xffff
#define UINT32_MAX 0xffffffffU
-#define UINT64_MAX UINT64_C(0xffffffffffffffff)
+
+#ifdef _LP64
+#define INT64_MIN (-0x7fffffffffffffff-1)
+#define INT64_MAX 0x7fffffffffffffff
+#define UINT64_MAX 0xffffffffffffffff
+#else
+#define INT64_MIN (-0x7fffffffffffffffLL-1)
+#define INT64_MAX 0x7fffffffffffffffLL
+#define UINT64_MAX 0xffffffffffffffffULL
+#endif
/*
* ISO/IEC 9899:1999