Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Mar 2012 20:02:20 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232519 - head/sys/x86/include
Message-ID:  <201203042002.q24K2KWF050460@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Sun Mar  4 20:02:20 2012
New Revision: 232519
URL: http://svn.freebsd.org/changeset/base/232519

Log:
  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

Modified:
  head/sys/x86/include/_stdint.h

Modified: head/sys/x86/include/_stdint.h
==============================================================================
--- head/sys/x86/include/_stdint.h	Sun Mar  4 19:22:52 2012	(r232518)
+++ head/sys/x86/include/_stdint.h	Sun Mar  4 20:02:20 2012	(r232519)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203042002.q24K2KWF050460>