diff options
author | mike <mike@FreeBSD.org> | 2002-07-08 16:43:35 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-07-08 16:43:35 +0000 |
commit | ebfda4c0dd6bcd6c81042231fbc8f0a68f0cc7cf (patch) | |
tree | fb88a472d1c60c155a3067ac65de70a1aaf477b4 | |
parent | 2363974e0c8427799636701e0abdf9f903a37253 (diff) | |
download | FreeBSD-src-ebfda4c0dd6bcd6c81042231fbc8f0a68f0cc7cf.zip FreeBSD-src-ebfda4c0dd6bcd6c81042231fbc8f0a68f0cc7cf.tar.gz |
Move __offsetof() macro from <machine/ansi.h> to <sys/cdefs.h>. It's
hardly MD, since all our platforms share the same macro. It's not
really compiler dependent either, but this helps in reducing
<machine/ansi.h> to only type definitions.
-rw-r--r-- | include/stddef.h | 1 | ||||
-rw-r--r-- | sys/alpha/include/ansi.h | 5 | ||||
-rw-r--r-- | sys/arm/include/ansi.h | 5 | ||||
-rw-r--r-- | sys/i386/include/ansi.h | 5 | ||||
-rw-r--r-- | sys/ia64/include/ansi.h | 5 | ||||
-rw-r--r-- | sys/powerpc/include/ansi.h | 5 | ||||
-rw-r--r-- | sys/sparc64/include/ansi.h | 5 | ||||
-rw-r--r-- | sys/sys/cdefs.h | 6 | ||||
-rw-r--r-- | sys/sys/queue.h | 2 |
9 files changed, 8 insertions, 31 deletions
diff --git a/include/stddef.h b/include/stddef.h index feeebc9..feb1cdc 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -38,6 +38,7 @@ #ifndef _STDDEF_H_ #define _STDDEF_H_ +#include <sys/cdefs.h> #include <machine/ansi.h> typedef _BSD_PTRDIFF_T_ ptrdiff_t; diff --git a/sys/alpha/include/ansi.h b/sys/alpha/include/ansi.h index 84591b9..c653384 100644 --- a/sys/alpha/include/ansi.h +++ b/sys/alpha/include/ansi.h @@ -119,11 +119,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLOCKS_PER_SEC_ 100 /* - * We define this here since both <stddef.h> and <sys/types.h> needs it. - */ -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) - -/* * Internal names for basic integral types. Omit the typedef if * not possible for a machine/compiler combination. */ diff --git a/sys/arm/include/ansi.h b/sys/arm/include/ansi.h index af323fd..dcf65ab 100644 --- a/sys/arm/include/ansi.h +++ b/sys/arm/include/ansi.h @@ -111,11 +111,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLOCKS_PER_SEC_ 100 /* - * We define this here since both <stddef.h> and <sys/types.h> needs it. - */ -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) - -/* * XXX this paragraph is very out of date. * Typedefs for especially magic types. #define's wouldn't work in the * __GNUC__ case, since __attribute__(()) only works in certain contexts. diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h index d81551d..2573c53 100644 --- a/sys/i386/include/ansi.h +++ b/sys/i386/include/ansi.h @@ -113,11 +113,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLOCKS_PER_SEC_ 128 /* - * We define this here since both <stddef.h> and <sys/types.h> needs it. - */ -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) - -/* * XXX this paragraph is very out of date. * Typedefs for especially magic types. #define's wouldn't work in the * __GNUC__ case, since __attribute__(()) only works in certain contexts. diff --git a/sys/ia64/include/ansi.h b/sys/ia64/include/ansi.h index 9e4d84b..188fbef 100644 --- a/sys/ia64/include/ansi.h +++ b/sys/ia64/include/ansi.h @@ -114,11 +114,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLOCKS_PER_SEC_ 100 /* - * We define this here since both <stddef.h> and <sys/types.h> needs it. - */ -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) - -/* * Internal names for basic integral types. Omit the typedef if * not possible for a machine/compiler combination. */ diff --git a/sys/powerpc/include/ansi.h b/sys/powerpc/include/ansi.h index e6d3298..a3f401e 100644 --- a/sys/powerpc/include/ansi.h +++ b/sys/powerpc/include/ansi.h @@ -120,11 +120,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLOCKS_PER_SEC_ 100 /* - * We define this here since both <stddef.h> and <sys/types.h> needs it. - */ -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) - -/* * Internal names for basic integral types. Omit the typedef if * not possible for a machine/compiler combination. */ diff --git a/sys/sparc64/include/ansi.h b/sys/sparc64/include/ansi.h index 8ff6361..f446941 100644 --- a/sys/sparc64/include/ansi.h +++ b/sys/sparc64/include/ansi.h @@ -114,11 +114,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/ #define _BSD_CLOCKS_PER_SEC_ 100 /* - * We define this here since both <stddef.h> and <sys/types.h> needs it. - */ -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) - -/* * Internal names for basic integral types. Omit the typedef if * not possible for a machine/compiler combination. */ diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index c98a094..32133f3 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -153,6 +153,12 @@ #endif /* + * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h> + * require it. + */ +#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) + +/* * Compiler-dependent macros to declare that functions take printf-like * or scanf-like arguments. They are null except for versions of gcc * that are known to support the features properly (old versions of gcc-2 diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 13e1a89..a86fda0 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -37,7 +37,7 @@ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ -#include <machine/ansi.h> /* for __offsetof */ +#include <sys/cdefs.h> /* * This file defines four types of data structures: singly-linked lists, |