diff options
author | tijl <tijl@FreeBSD.org> | 2011-01-08 11:47:55 +0000 |
---|---|---|
committer | tijl <tijl@FreeBSD.org> | 2011-01-08 11:47:55 +0000 |
commit | 61d89c0b21ee8ee88c291bd781b885c9ff0d6245 (patch) | |
tree | b3ae794e20e8dfd11eb0ed255f66db6b6d3a1ac0 /sys/powerpc/include | |
parent | af03e997bad671908fbc09a2cabaf5b32eda911f (diff) | |
download | FreeBSD-src-61d89c0b21ee8ee88c291bd781b885c9ff0d6245.zip FreeBSD-src-61d89c0b21ee8ee88c291bd781b885c9ff0d6245.tar.gz |
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)
Diffstat (limited to 'sys/powerpc/include')
-rw-r--r-- | sys/powerpc/include/_types.h | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/sys/powerpc/include/_types.h b/sys/powerpc/include/_types.h index b550035..a6e393e 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 /* |