Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jan 2011 11:47:55 +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: r217146 - in head/sys: arm/include i386/include mips/include powerpc/include sys
Message-ID:  <201101081147.p08BltfD090985@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Sat Jan  8 11:47:55 2011
New Revision: 217146
URL: http://svn.freebsd.org/changeset/base/217146

Log:
  On 32 bit architectures define (u)int64_t as (unsigned) long long instead
  of (unsigned) int __attribute__((__mode__(__DI__))). This aligns better
  with macros such as (U)INT64_C, (U)INT64_MAX, etc. which assume (u)int64_t
  has type (unsigned) long long.
  
  The mode attribute was used because long long wasn't standardised until
  C99. Nowadays compilers should support long long and use of the mode
  attribute is discouraged according to GCC Internals documentation.
  
  The type definition has to be marked with __extension__ to support
  compilation with "-std=c89 -pedantic".
  
  Discussed with:	bde
  Approved by:	kib (mentor)

Modified:
  head/sys/arm/include/_types.h
  head/sys/i386/include/_types.h
  head/sys/mips/include/_types.h
  head/sys/powerpc/include/_types.h
  head/sys/sys/cdefs.h

Modified: head/sys/arm/include/_types.h
==============================================================================
--- head/sys/arm/include/_types.h	Sat Jan  8 11:13:34 2011	(r217145)
+++ head/sys/arm/include/_types.h	Sat Jan  8 11:47:55 2011	(r217146)
@@ -52,16 +52,16 @@ typedef	short			__int16_t;
 typedef	unsigned short		__uint16_t;
 typedef	int			__int32_t;
 typedef	unsigned int		__uint32_t;
-
-#ifdef __GNUCLIKE_ATTRIBUTE_MODE_DI
-typedef	int __attribute__((__mode__(__DI__)))		__int64_t;
-typedef	unsigned int __attribute__((__mode__(__DI__)))	__uint64_t;
-#else
+#ifndef lint
+__extension__
+#endif
 /* LONGLONG */
 typedef	long long		__int64_t;
+#ifndef lint
+__extension__
+#endif
 /* LONGLONG */
 typedef	unsigned long long	__uint64_t;
-#endif
 
 /*
  * Standard type definitions.

Modified: head/sys/i386/include/_types.h
==============================================================================
--- head/sys/i386/include/_types.h	Sat Jan  8 11:13:34 2011	(r217145)
+++ head/sys/i386/include/_types.h	Sat Jan  8 11:47:55 2011	(r217146)
@@ -54,21 +54,16 @@ typedef	short			__int16_t;
 typedef	unsigned short		__uint16_t;
 typedef	int			__int32_t;
 typedef	unsigned int		__uint32_t;
-
-#if defined(lint)
-/* LONGLONG */
-typedef	long long		__int64_t;
-/* LONGLONG */
-typedef	unsigned long long	__uint64_t;
-#elif defined(__GNUCLIKE_ATTRIBUTE_MODE_DI)
-typedef	int __attribute__((__mode__(__DI__)))		__int64_t;
-typedef	unsigned int __attribute__((__mode__(__DI__)))	__uint64_t;
-#else
+#ifndef lint
+__extension__
+#endif
 /* LONGLONG */
 typedef	long long		__int64_t;
+#ifndef lint
+__extension__
+#endif
 /* LONGLONG */
 typedef	unsigned long long	__uint64_t;
-#endif
 
 /*
  * Standard type definitions.

Modified: head/sys/mips/include/_types.h
==============================================================================
--- head/sys/mips/include/_types.h	Sat Jan  8 11:13:34 2011	(r217145)
+++ head/sys/mips/include/_types.h	Sat Jan  8 11:47:55 2011	(r217146)
@@ -53,26 +53,21 @@ typedef	short			__int16_t;
 typedef	unsigned short		__uint16_t;
 typedef	int			__int32_t;
 typedef	unsigned int		__uint32_t;
-
 #ifdef __mips_n64
 typedef	long			__int64_t;
 typedef	unsigned long		__uint64_t;
 #else
-#if defined(lint)
-/* LONGLONG */
-typedef	long long		__int64_t;
-/* LONGLONG */
-typedef	unsigned long long	__uint64_t;
-#elif defined(__GNUCLIKE_ATTRIBUTE_MODE_DI)
-typedef	int __attribute__((__mode__(__DI__)))		__int64_t;
-typedef	unsigned int __attribute__((__mode__(__DI__)))	__uint64_t;
-#else
+#ifndef lint
+__extension__
+#endif
 /* LONGLONG */
 typedef	long long		__int64_t;
+#ifndef lint
+__extension__
+#endif
 /* LONGLONG */
 typedef	unsigned long long	__uint64_t;
 #endif
-#endif
 
 /*
  * Standard type definitions.

Modified: head/sys/powerpc/include/_types.h
==============================================================================
--- head/sys/powerpc/include/_types.h	Sat Jan  8 11:13:34 2011	(r217145)
+++ head/sys/powerpc/include/_types.h	Sat Jan  8 11:47:55 2011	(r217146)
@@ -52,29 +52,20 @@ typedef	short			__int16_t;
 typedef	unsigned short		__uint16_t;
 typedef	int			__int32_t;
 typedef	unsigned int		__uint32_t;
-
 #ifdef __powerpc64__
-
 typedef	long			__int64_t;
 typedef	unsigned long		__uint64_t;
-
 #else
-
-#if defined(lint)
-/* LONGLONG */
-typedef long long		__int64_t;
-/* LONGLONG */
-typedef unsigned long long	__uint64_t;
-#elif defined(__GNUCLIKE_ATTRIBUTE_MODE_DI)
-typedef int __attribute__((__mode__(__DI__)))		__int64_t;
-typedef unsigned int __attribute__((__mode__(__DI__)))	__uint64_t;
-#else
-/* LONGLONG */
-typedef long long		__int64_t;
+#ifndef lint
+__extension__
+#endif
 /* LONGLONG */
-typedef unsigned long long	__uint64_t;
+typedef	long long		__int64_t;
+#ifndef lint
+__extension__
 #endif
-
+/* LONGLONG */
+typedef	unsigned long long	__uint64_t;
 #endif
 
 /*

Modified: head/sys/sys/cdefs.h
==============================================================================
--- head/sys/sys/cdefs.h	Sat Jan  8 11:13:34 2011	(r217145)
+++ head/sys/sys/cdefs.h	Sat Jan  8 11:47:55 2011	(r217146)
@@ -62,8 +62,6 @@
 #define __GNUCLIKE___OFFSETOF 1
 #define __GNUCLIKE___SECTION 1
 
-#define __GNUCLIKE_ATTRIBUTE_MODE_DI 1
-
 #ifndef __INTEL_COMPILER
 # define __GNUCLIKE_CTOR_SECTION_HANDLING 1
 #endif



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