summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-04-06 04:42:10 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-04-06 04:42:10 +0000
commitffceee0a9bdf5623166b2e619112624678bdd7d6 (patch)
tree6b4c1cde2b4bfeae53032bc8bd9ddd33aa7b1f10
parentccea5a5a7c92530c31d0d76d0c1b2fd4ccf7e938 (diff)
Move offsetof define into sys/param.h
-rw-r--r--sys/arch/alpha/alpha/genassym.c4
-rw-r--r--sys/arch/alpha/alpha/prom.c5
-rw-r--r--sys/arch/sparc/dev/cgtwo.c5
-rw-r--r--sys/arch/sparc/sparc/trap.c4
-rw-r--r--sys/dev/ic/aac.c5
-rw-r--r--sys/dev/ic/advlib.h4
-rw-r--r--sys/dev/ic/adwlib.h4
-rw-r--r--sys/dev/ic/aic7xxx.c3
-rw-r--r--sys/dev/ic/fxp.c4
-rw-r--r--sys/dev/ic/pcdisplayvar.h4
-rw-r--r--sys/dev/ic/pdqreg.h6
-rw-r--r--sys/dev/pci/ncr.c6
-rw-r--r--sys/kern/subr_log.c4
-rw-r--r--sys/kern/uipc_usrreq.c3
-rw-r--r--sys/net/if_enc.c6
-rw-r--r--sys/netinet/in_gif.c6
-rw-r--r--sys/netinet/ip_ah.c6
-rw-r--r--sys/netinet/ip_esp.c6
-rw-r--r--sys/netinet/ip_ether.c6
-rw-r--r--sys/netinet/ip_ipip.c6
-rw-r--r--sys/netinet/ip_ipsp.c6
-rw-r--r--sys/netinet/ip_output.c6
-rw-r--r--sys/netinet/ip_spd.c6
-rw-r--r--sys/netinet/ipsec_input.c6
-rw-r--r--sys/netinet/ipsec_output.c6
-rw-r--r--sys/netinet/tcp_subr.c6
-rw-r--r--sys/netinet6/in6_proto.c4
-rw-r--r--sys/netinet6/raw_ip6.c4
-rw-r--r--sys/sys/param.h7
29 files changed, 35 insertions, 113 deletions
diff --git a/sys/arch/alpha/alpha/genassym.c b/sys/arch/alpha/alpha/genassym.c
index 873c9fd7f10..bce562f86d9 100644
--- a/sys/arch/alpha/alpha/genassym.c
+++ b/sys/arch/alpha/alpha/genassym.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: genassym.c,v 1.9 2001/01/15 11:58:54 art Exp $ */
+/* $OpenBSD: genassym.c,v 1.10 2001/04/06 04:42:05 csapuntz Exp $ */
/* $NetBSD: genassym.c,v 1.27 2000/05/26 00:36:42 thorpej Exp $ */
/*
@@ -87,8 +87,6 @@
extern void printf __P((const char *fmt, ...));
extern void exit __P((int));
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-
#ifdef __STDC__
#define def(name, value) { #name, value }
#define def1(name) { #name, name }
diff --git a/sys/arch/alpha/alpha/prom.c b/sys/arch/alpha/alpha/prom.c
index 62c6fe610ca..026598b97f9 100644
--- a/sys/arch/alpha/alpha/prom.c
+++ b/sys/arch/alpha/alpha/prom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: prom.c,v 1.9 2001/01/20 20:27:40 art Exp $ */
+/* $OpenBSD: prom.c,v 1.10 2001/04/06 04:42:05 csapuntz Exp $ */
/* $NetBSD: prom.c,v 1.39 2000/03/06 21:36:05 thorpej Exp $ */
/*
@@ -295,9 +295,6 @@ hwrpb_checksum()
u_int64_t *p, sum;
int i;
-#ifndef offsetof
-#define offsetof(type, member) ((size_t)(&((type *)0)->member)) /* XXX */
-#endif
for (i = 0, p = (u_int64_t *)hwrpb, sum = 0;
i < (offsetof(struct rpb, rpb_checksum) / sizeof (u_int64_t));
i++, p++)
diff --git a/sys/arch/sparc/dev/cgtwo.c b/sys/arch/sparc/dev/cgtwo.c
index 70fbc0b76b6..17015c99929 100644
--- a/sys/arch/sparc/dev/cgtwo.c
+++ b/sys/arch/sparc/dev/cgtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgtwo.c,v 1.13 1999/09/10 23:32:02 art Exp $ */
+/* $OpenBSD: cgtwo.c,v 1.14 2001/04/06 04:42:05 csapuntz Exp $ */
/* $NetBSD: cgtwo.c,v 1.22 1997/05/24 20:16:12 pk Exp $ */
/*
@@ -222,9 +222,6 @@ cgtwoattach(parent, self, args)
sc->sc_fb.fb_pixels = mapiodev(&sc->sc_phys, CG2_PIXMAP_OFF,
CG2_PIXMAP_SIZE);
}
-#ifndef offsetof
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-#endif
sc->sc_reg = (volatile struct cg2statusreg *)
mapiodev(ca->ca_ra.ra_reg,
diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c
index c1ed8e3dff0..4e0dadc677f 100644
--- a/sys/arch/sparc/sparc/trap.c
+++ b/sys/arch/sparc/sparc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.26 2000/11/10 18:15:42 art Exp $ */
+/* $OpenBSD: trap.c,v 1.27 2001/04/06 04:42:06 csapuntz Exp $ */
/* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */
/*
@@ -88,8 +88,6 @@
#include <sparc/sparc/memreg.h>
#include <sparc/sparc/cpuvar.h>
-#define offsetof(s, f) ((int)&((s *)0)->f)
-
extern int cold;
#ifdef DEBUG
diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c
index 91f4d7410fc..6de5a326f0a 100644
--- a/sys/dev/ic/aac.c
+++ b/sys/dev/ic/aac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aac.c,v 1.3 2000/12/13 16:03:11 mickey Exp $ */
+/* $OpenBSD: aac.c,v 1.4 2001/04/06 04:42:06 csapuntz Exp $ */
/*-
* Copyright (c) 2000 Michael Smith
@@ -62,9 +62,6 @@
#include <dev/ic/aacvar.h>
#include <dev/ic/aac_tables.h>
-/* XXX from stddef.h */
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-
/* Geometry constants. */
#define AAC_MAXCYLS 1024
#define AAC_HEADS 64
diff --git a/sys/dev/ic/advlib.h b/sys/dev/ic/advlib.h
index fc6e1a9409d..78590938ff6 100644
--- a/sys/dev/ic/advlib.h
+++ b/sys/dev/ic/advlib.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: advlib.h,v 1.4 1998/11/17 06:08:15 downsj Exp $ */
+/* $OpenBSD: advlib.h,v 1.5 2001/04/06 04:42:06 csapuntz Exp $ */
/* $NetBSD: advlib.h,v 1.5 1998/10/28 20:39:46 dante Exp $ */
/*
@@ -1337,6 +1337,4 @@ int AscResetDevice __P((ASC_SOFTC *, u_char));
/******************************************************************************/
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-
#endif /* _ADVANSYS_NARROW_LIBRARY_H_ */
diff --git a/sys/dev/ic/adwlib.h b/sys/dev/ic/adwlib.h
index a8db327aa8c..35c8937327f 100644
--- a/sys/dev/ic/adwlib.h
+++ b/sys/dev/ic/adwlib.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: adwlib.h,v 1.7 2001/02/22 17:17:32 krw Exp $ */
+/* $OpenBSD: adwlib.h,v 1.8 2001/04/06 04:42:06 csapuntz Exp $ */
/* $NetBSD: adwlib.h,v 1.14 2000/07/03 18:14:18 dante Exp $ */
/*
@@ -1125,6 +1125,4 @@ int AdwSendIdleCmd __P((ADW_SOFTC *, u_int16_t, u_int32_t));
int AdwResetSCSIBus __P((ADW_SOFTC *));
int AdwResetCCB __P((ADW_SOFTC *));
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-
#endif /* _ADVANSYS_WIDE_LIBRARY_H_ */
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index 56d8b4ee5aa..837e44504fd 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.40 2000/01/07 23:08:17 gibbs Exp $
- * $OpenBSD: aic7xxx.c,v 1.25 2001/03/25 06:15:37 csapuntz Exp $
+ * $OpenBSD: aic7xxx.c,v 1.26 2001/04/06 04:42:06 csapuntz Exp $
*/
/*
* A few notes on features of the driver.
@@ -122,7 +122,6 @@
#define AHC_TMODE_ENABLE 0
#endif
#include <sys/kernel.h>
-#define offsetof(s, e) ((char *)&((s *)0)->e - (char *)((s *)0))
#ifndef le32toh
#define le32toh letoh32 /* to match Free/Net macros */
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index cc5a8fb3769..e0362403589 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.12 2001/03/22 01:38:05 angelos Exp $ */
+/* $OpenBSD: fxp.c,v 1.13 2001/04/06 04:42:05 csapuntz Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -98,8 +98,6 @@
#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)(va))
#endif /* __alpha__ */
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-
/*
* NOTE! On the Alpha, we have an alignment constraint. The
* card DMAs the packet immediately following the RFA. However,
diff --git a/sys/dev/ic/pcdisplayvar.h b/sys/dev/ic/pcdisplayvar.h
index d3ed5537585..dd563726541 100644
--- a/sys/dev/ic/pcdisplayvar.h
+++ b/sys/dev/ic/pcdisplayvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcdisplayvar.h,v 1.2 2001/02/02 20:25:39 aaron Exp $ */
+/* $OpenBSD: pcdisplayvar.h,v 1.3 2001/04/06 04:42:05 csapuntz Exp $ */
/* $NetBSD: pcdisplayvar.h,v 1.8 2000/01/25 02:44:03 ad Exp $ */
/*
@@ -37,8 +37,6 @@
#include "opt_pcdisplay.h"
#endif
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-
struct pcdisplayscreen {
struct pcdisplay_handle *hdl;
diff --git a/sys/dev/ic/pdqreg.h b/sys/dev/ic/pdqreg.h
index 6d9f803d999..a9d5a3f09e6 100644
--- a/sys/dev/ic/pdqreg.h
+++ b/sys/dev/ic/pdqreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdqreg.h,v 1.7 1996/10/31 01:01:38 niklas Exp $ */
+/* $OpenBSD: pdqreg.h,v 1.8 2001/04/06 04:42:06 csapuntz Exp $ */
/* $NetBSD: pdqreg.h,v 1.6 1996/08/28 16:01:29 cgd Exp $ */
/*-
@@ -45,10 +45,6 @@
#define PDQ_ASSERT(x) do { } while(0)
#endif
#else /* __NetBSD__ || __OpenBSD__*/
-/*
- * Including user-land headers in kernel code is not allowed in Net- or OpenBSD
- */
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
/*
* Can't directly use "assert", because apparently cpp won't expand it
diff --git a/sys/dev/pci/ncr.c b/sys/dev/pci/ncr.c
index 01ce9e3254f..e2bb618bdce 100644
--- a/sys/dev/pci/ncr.c
+++ b/sys/dev/pci/ncr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr.c,v 1.53 2001/01/25 03:50:51 todd Exp $ */
+/* $OpenBSD: ncr.c,v 1.54 2001/04/06 04:42:07 csapuntz Exp $ */
/* $NetBSD: ncr.c,v 1.63 1997/09/23 02:39:15 perry Exp $ */
/**************************************************************************
@@ -211,8 +211,6 @@
#include <stddef.h>
#endif
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-
#include <sys/param.h>
#include <sys/time.h>
@@ -1466,7 +1464,7 @@ static void ncr_attach (pcici_t tag, int unit);
#if 0
static char ident[] =
- "\n$OpenBSD: ncr.c,v 1.53 2001/01/25 03:50:51 todd Exp $\n";
+ "\n$OpenBSD: ncr.c,v 1.54 2001/04/06 04:42:07 csapuntz Exp $\n";
#endif
static const u_long ncr_version = NCR_VERSION * 11
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index 00eb5a93bc9..dd990012764 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_log.c,v 1.6 2000/02/22 19:28:03 deraadt Exp $ */
+/* $OpenBSD: subr_log.c,v 1.7 2001/04/06 04:42:07 csapuntz Exp $ */
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
/*
@@ -69,8 +69,6 @@ int msgbufmapped; /* is the message buffer mapped */
int msgbufenabled; /* is logging to the buffer enabled */
struct msgbuf *msgbufp; /* the mapped buffer, itself. */
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-
void
initmsgbuf(buf, bufsize)
caddr_t buf;
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index e6065f9b148..184eaaedb45 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.11 1999/10/11 19:49:39 deraadt Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.12 2001/04/06 04:42:07 csapuntz Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -403,7 +403,6 @@ unp_bind(unp, nam, p)
if (unp->unp_vnode != NULL)
return (EINVAL);
-#define offsetof(s, e) ((char *)&((s *)0)->e - (char *)((s *)0))
namelen = soun->sun_len - offsetof(struct sockaddr_un, sun_path);
if (namelen <= 0 || namelen >= MLEN)
return EINVAL;
diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c
index de1f7e5b7e3..308d36f8740 100644
--- a/sys/net/if_enc.c
+++ b/sys/net/if_enc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_enc.c,v 1.32 2000/12/30 22:56:23 angelos Exp $ */
+/* $OpenBSD: if_enc.c,v 1.33 2001/04/06 04:42:07 csapuntz Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -91,10 +91,6 @@ extern struct ifqueue nsintrq;
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
struct enc_softc encif[NENC];
void encattach __P((int));
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c
index 5b35e3c3745..c59399a1bc8 100644
--- a/sys/netinet/in_gif.c
+++ b/sys/netinet/in_gif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_gif.c,v 1.14 2001/02/16 08:48:04 itojun Exp $ */
+/* $OpenBSD: in_gif.c,v 1.15 2001/04/06 04:42:08 csapuntz Exp $ */
/* $KAME: in_gif.c,v 1.50 2001/01/22 07:27:16 itojun Exp $ */
/*
@@ -72,10 +72,6 @@
#include <net/net_osdep.h>
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
int
in_gif_output(ifp, family, m, rt)
struct ifnet *ifp;
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c
index 3afe50155e6..09373cf3bad 100644
--- a/sys/netinet/ip_ah.c
+++ b/sys/netinet/ip_ah.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.c,v 1.48 2001/03/28 20:03:02 angelos Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.49 2001/04/06 04:42:08 csapuntz Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -83,10 +83,6 @@
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
/*
* ah_attach() is called from the transformation initialization code
*/
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c
index e6889dc624f..4d9fa3574c7 100644
--- a/sys/netinet/ip_esp.c
+++ b/sys/netinet/ip_esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp.c,v 1.54 2001/03/28 20:03:03 angelos Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.55 2001/04/06 04:42:08 csapuntz Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -87,10 +87,6 @@
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
/*
* esp_attach() is called from the transformation initialization code.
*/
diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c
index c35c53ece7a..5bb2cfad8ae 100644
--- a/sys/netinet/ip_ether.c
+++ b/sys/netinet/ip_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ether.c,v 1.25 2001/02/07 20:52:13 mickey Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.26 2001/04/06 04:42:08 csapuntz Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
@@ -67,10 +67,6 @@
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
/*
* We can control the acceptance of EtherIP packets by altering the sysctl
* net.inet.etherip.allow value. Zero means drop them, all else is acceptance.
diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c
index 2eb74ac7399..8f010625dbd 100644
--- a/sys/netinet/ip_ipip.c
+++ b/sys/netinet/ip_ipip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipip.c,v 1.11 2001/03/28 20:03:04 angelos Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.12 2001/04/06 04:42:08 csapuntz Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -83,10 +83,6 @@
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
/*
* We can control the acceptance of IP4 packets by altering the sysctl
* net.inet.ipip.allow value. Zero means drop them, all else is acceptance.
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index 16e9fcad43a..7161e90658b 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.112 2001/03/28 20:34:03 angelos Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.113 2001/04/06 04:42:08 csapuntz Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -83,10 +83,6 @@ void tdb_hashstats(void);
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
#ifdef __GNUC__
#define INLINE static __inline
#endif
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 94fba169a40..9d32e1206a0 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.87 2001/03/28 20:03:04 angelos Exp $ */
+/* $OpenBSD: ip_output.c,v 1.88 2001/04/06 04:42:08 csapuntz Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -80,10 +80,6 @@
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
extern u_int8_t get_sa_require __P((struct inpcb *));
extern int ipsec_auth_default_level;
diff --git a/sys/netinet/ip_spd.c b/sys/netinet/ip_spd.c
index e5594943053..c1491449b59 100644
--- a/sys/netinet/ip_spd.c
+++ b/sys/netinet/ip_spd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_spd.c,v 1.14 2001/03/28 20:03:06 angelos Exp $ */
+/* $OpenBSD: ip_spd.c,v 1.15 2001/04/06 04:42:08 csapuntz Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -61,10 +61,6 @@
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
/*
* Lookup at the SPD based on the headers contained on the mbuf. The second
* argument indicates what protocol family the header at the beginning of
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c
index e3284ddb362..2655b16bd05 100644
--- a/sys/netinet/ipsec_input.c
+++ b/sys/netinet/ipsec_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_input.c,v 1.35 2001/03/30 19:22:54 angelos Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.36 2001/04/06 04:42:08 csapuntz Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -85,10 +85,6 @@ int ipsec_common_input(struct mbuf *, int, int, int, int);
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
/* sysctl variables */
int esp_enable = 0;
int ah_enable = 0;
diff --git a/sys/netinet/ipsec_output.c b/sys/netinet/ipsec_output.c
index 2882091411c..0f7c9bae0cc 100644
--- a/sys/netinet/ipsec_output.c
+++ b/sys/netinet/ipsec_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_output.c,v 1.4 2001/03/28 20:03:06 angelos Exp $ */
+/* $OpenBSD: ipsec_output.c,v 1.5 2001/04/06 04:42:08 csapuntz Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -57,10 +57,6 @@
#define DPRINTF(x)
#endif
-#ifndef offsetof
-#define offsetof(s, e) ((int)&((s *)0)->e)
-#endif
-
/*
* Loop over a tdb chain, taking into consideration protocol tunneling. The
* fourth argument is set if the first encapsulation header is already in
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 02b24889d21..4bc0ae71247 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_subr.c,v 1.40 2001/03/14 19:21:33 mickey Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.41 2001/04/06 04:42:09 csapuntz Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@@ -89,10 +89,6 @@ didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>.
#include <sys/md5k.h>
#endif /* TCP_SIGNATURE */
-#ifndef offsetof
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-#endif
-
/* patchable/settable parameters for tcp */
int tcp_mssdflt = TCP_MSS;
int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index d46491b9cf6..4b324026561 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_proto.c,v 1.26 2000/12/11 08:04:56 itojun Exp $ */
+/* $OpenBSD: in6_proto.c,v 1.27 2001/04/06 04:42:09 csapuntz Exp $ */
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
/*
@@ -109,8 +109,6 @@
#include <net/net_osdep.h>
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-
/*
* TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
*/
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 0f735c0b9fa..579393ec27a 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.4 2001/03/04 16:48:25 itojun Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.5 2001/04/06 04:42:09 csapuntz Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -474,8 +474,6 @@ rip6_output(m, va_alist)
int off;
u_int16_t sum;
-#define offsetof(type, member) ((size_t)(&((type *)0)->member)) /* XXX */
-
/* compute checksum */
if (so->so_proto->pr_protocol == IPPROTO_ICMPV6)
off = offsetof(struct icmp6_hdr, icmp6_cksum);
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 7c7d428f602..2b5c9702e51 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.32 2001/01/31 23:34:15 deraadt Exp $ */
+/* $OpenBSD: param.h,v 1.33 2001/04/06 04:42:05 csapuntz Exp $ */
/* $NetBSD: param.h,v 1.23 1996/03/17 01:02:29 thorpej Exp $ */
/*-
@@ -194,6 +194,11 @@
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
+/* Macros for calculating the offset of a field */
+#ifndef offsetof
+#define offsetof(s, e) ((unsigned int)&((s *)0)->e)
+#endif
+
/*
* Constants for setting the parameters of the kernel memory allocator.
*