diff options
author | obrien <obrien@FreeBSD.org> | 2001-05-16 22:21:43 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-05-16 22:21:43 +0000 |
commit | 9e804492abbf2ff2087fc952f4b0b98a6e3f8ba7 (patch) | |
tree | 4bd7c843825e39ddad15d6b709d50b00674e9921 /sys/i386 | |
parent | 047f94e139274ab9ae2ec877bada1ddcc4756cc5 (diff) | |
download | FreeBSD-src-9e804492abbf2ff2087fc952f4b0b98a6e3f8ba7.zip FreeBSD-src-9e804492abbf2ff2087fc952f4b0b98a6e3f8ba7.tar.gz |
Move the int typedefs to the top so they can be used in defining other types.
Ensure every platform has __offsetof.
Make multiple inclusion detection consistent with other
<platform>/include/*.h files.
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/include/ansi.h | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h index fe11c9a..b9b62da 100644 --- a/sys/i386/include/ansi.h +++ b/sys/i386/include/ansi.h @@ -38,6 +38,36 @@ #define _MACHINE_ANSI_H_ /* + * Typedefs for especially magic types. #define's wouldn't work in the + * __GNUC__ case, since __attribute__(()) only works in certain contexts. + * This is not in <machine/types.h>, since that has too much namespace + * pollution for inclusion in ANSI headers, yet we need __int64_t in at + * least <stdio.h>. + */ +#ifdef __GNUC__ +typedef int __attribute__((__mode__(__DI__))) __int64_t; +typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t; +#else +/* LONGLONG */ +typedef long long __int64_t; +/* LONGLONG */ +typedef unsigned long long __uint64_t; +#endif +/* + * Internal names for basic integral types. Omit the typedef if + * not possible for a machine/compiler combination. + */ +typedef __signed char __int8_t; +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; + +typedef int __intptr_t; +typedef unsigned int __uintptr_t; + +/* * Types which are fundamental to the implementation and must be declared * in more than one standard header are defined here. Standard headers * then use: @@ -98,34 +128,4 @@ */ #define __offsetof(type, field) ((size_t)(&((type *)0)->field)) -/* - * Typedefs for especially magic types. #define's wouldn't work in the - * __GNUC__ case, since __attribute__(()) only works in certain contexts. - * This is not in <machine/types.h>, since that has too much namespace - * pollution for inclusion in ANSI headers, yet we need __int64_t in at - * least <stdio.h>. - */ -#ifdef __GNUC__ -typedef int __attribute__((__mode__(__DI__))) __int64_t; -typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t; -#else -/* LONGLONG */ -typedef long long __int64_t; -/* LONGLONG */ -typedef unsigned long long __uint64_t; -#endif -/* - * Internal names for basic integral types. Omit the typedef if - * not possible for a machine/compiler combination. - */ -typedef __signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; - -typedef int __intptr_t; -typedef unsigned int __uintptr_t; - #endif /* !_MACHINE_ANSI_H_ */ |