summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2001-03-05 13:09:13 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2001-03-05 13:09:13 +0000
commit250ca53067c7d9dd1e8993dbe55b6b9082aca074 (patch)
tree5c91247629fafc3b80f69b62c1da8b2cc14c30c4 /include
parentdc6a64b2e84e1d8faa4eef4552a215f000cc7a1d (diff)
downloadsrc-test2-250ca53067c7d9dd1e8993dbe55b6b9082aca074.tar.gz
src-test2-250ca53067c7d9dd1e8993dbe55b6b9082aca074.zip
Notes
Diffstat (limited to 'include')
-rw-r--r--include/stddef.h4
-rw-r--r--include/struct.h6
2 files changed, 9 insertions, 1 deletions
diff --git a/include/stddef.h b/include/stddef.h
index 38a773636a78..feeebc90f784 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -31,6 +31,8 @@
* SUCH DAMAGE.
*
* @(#)stddef.h 8.1 (Berkeley) 6/2/93
+ *
+ * $FreeBSD$
*/
#ifndef _STDDEF_H_
@@ -61,6 +63,6 @@ typedef _BSD_WCHAR_T_ wchar_t;
#define NULL 0
#endif
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
+#define offsetof(type, member) __offsetof(type, member)
#endif /* _STDDEF_H_ */
diff --git a/include/struct.h b/include/struct.h
index f80ecd077132..c32ec28e64e0 100644
--- a/include/struct.h
+++ b/include/struct.h
@@ -31,11 +31,17 @@
* SUCH DAMAGE.
*
* @(#)struct.h 8.1 (Berkeley) 6/2/93
+ *
+ * $FreeBSD$
*/
#ifndef _STRUCT_H_
#define _STRUCT_H_
+#if __GNUC__
+#warning "this file includes <struct.h> which is deprecated, use <stddef.h> instead"
+#endif
+
/* Offset of the field in the structure. */
#define fldoff(name, field) \
((int)&(((struct name *)0)->field))