Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2012 16:02:52 +0000 (UTC)
From:      Andreas Tobler <andreast@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r229494 - head/sys/powerpc/include
Message-ID:  <201201041602.q04G2qjX085435@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andreast
Date: Wed Jan  4 16:02:52 2012
New Revision: 229494
URL: http://svn.freebsd.org/changeset/base/229494

Log:
  Introduce internal macros for __U/INT64_C to define the U/INT64_MAX/MIN
  values properly. The previous definition only worked if __STDC_LIMIT_MACROS
  and __STDC_CONSTANT_MACROS were defined at the same time.

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

Modified: head/sys/powerpc/include/_stdint.h
==============================================================================
--- head/sys/powerpc/include/_stdint.h	Wed Jan  4 15:59:49 2012	(r229493)
+++ head/sys/powerpc/include/_stdint.h	Wed Jan  4 16:02:52 2012	(r229494)
@@ -65,6 +65,14 @@
 
 #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
 
+#ifdef __LP64__
+#define	__INT64_C(c)		(c ## L)
+#define	__UINT64_C(c)		(c ## UL)
+#else
+#define	__INT64_C(c)		(c ## LL)
+#define	__UINT64_C(c)		(c ## ULL)
+#endif
+
 /*
  * ISO/IEC 9899:1999
  * 7.18.2.1 Limits of exact-width integer types
@@ -73,19 +81,19 @@
 #define	INT8_MIN	(-0x7f-1)
 #define	INT16_MIN	(-0x7fff-1)
 #define	INT32_MIN	(-0x7fffffff-1)
-#define	INT64_MIN	(-INT64_C(0x7fffffffffffffff)-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)
+#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	0xffffffff
-#define	UINT64_MAX	UINT64_C(0xffffffffffffffff)
+#define	UINT64_MAX	__UINT64_C(0xffffffffffffffff)
 
 /*
  * ISO/IEC 9899:1999



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