diff options
author | Tijl Coosemans <tijl@FreeBSD.org> | 2011-01-08 11:47:55 +0000 |
---|---|---|
committer | Tijl Coosemans <tijl@FreeBSD.org> | 2011-01-08 11:47:55 +0000 |
commit | d942996bafc6a4297ac42eef1babfc5e78b2867d (patch) | |
tree | b3ae794e20e8dfd11eb0ed255f66db6b6d3a1ac0 | |
parent | 9858863cd4959006703cb9529d07777637315c69 (diff) |
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)
Notes
Notes:
svn path=/head/; revision=217146
-rw-r--r-- | sys/arm/include/_types.h | 12 | ||||
-rw-r--r-- | sys/i386/include/_types.h | 17 | ||||
-rw-r--r-- | sys/mips/include/_types.h | 17 | ||||
-rw-r--r-- | sys/powerpc/include/_types.h | 25 | ||||
-rw-r--r-- | sys/sys/cdefs.h | 2 |
5 files changed, 26 insertions, 47 deletions
diff --git a/sys/arm/include/_types.h b/sys/arm/include/_types.h index 2b96d2ebf086..48dd2a784fd7 100644 --- a/sys/arm/include/_types.h +++ b/sys/arm/include/_types.h @@ -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. diff --git a/sys/i386/include/_types.h b/sys/i386/include/_types.h index 9810e0ee8b18..7a969fedf160 100644 --- a/sys/i386/include/_types.h +++ b/sys/i386/include/_types.h @@ -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. diff --git a/sys/mips/include/_types.h b/sys/mips/include/_types.h index 1fd760f9cb50..1c4af4940dd2 100644 --- a/sys/mips/include/_types.h +++ b/sys/mips/include/_types.h @@ -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. diff --git a/sys/powerpc/include/_types.h b/sys/powerpc/include/_types.h index b550035c7b05..a6e393ec4fa1 100644 --- a/sys/powerpc/include/_types.h +++ b/sys/powerpc/include/_types.h @@ -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 /* diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 958c74d5ff6a..d1d48370a7ab 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -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 |