diff --git a/games/quake2/patches/patch-src_baseq2_g_local_h b/games/quake2/patches/patch-src_baseq2_g_local_h new file mode 100644 index 00000000000..687aa1d551e --- /dev/null +++ b/games/quake2/patches/patch-src_baseq2_g_local_h @@ -0,0 +1,19 @@ +$OpenBSD: patch-src_baseq2_g_local_h,v 1.1 2010/06/07 16:03:40 espie Exp $ +--- src/baseq2/g_local.h.orig Mon Jun 7 17:57:55 2010 ++++ src/baseq2/g_local.h Mon Jun 7 17:58:55 2010 +@@ -505,10 +505,11 @@ extern int meansOfDeath; + + extern edict_t *g_edicts; + +-#define FOFS(x) (int)&(((edict_t *)0)->x) +-#define STOFS(x) (int)&(((spawn_temp_t *)0)->x) +-#define LLOFS(x) (int)&(((level_locals_t *)0)->x) +-#define CLOFS(x) (int)&(((gclient_t *)0)->x) ++#include ++#define FOFS(x) offsetof(edict_t, x) ++#define STOFS(x) offsetof(spawn_temp_t, x) ++#define LLOFS(x) offsetof(level_locals_t, x) ++#define CLOFS(x) offsetof(gclient_t, x) + + #define random() ((rand () & 0x7fff) / ((float)0x7fff)) + #define crandom() (2.0 * (random() - 0.5)) diff --git a/games/quake2/patches/patch-src_ctf_g_local_h b/games/quake2/patches/patch-src_ctf_g_local_h new file mode 100644 index 00000000000..1ece1773026 --- /dev/null +++ b/games/quake2/patches/patch-src_ctf_g_local_h @@ -0,0 +1,19 @@ +$OpenBSD: patch-src_ctf_g_local_h,v 1.1 2010/06/07 16:03:40 espie Exp $ +--- src/ctf/g_local.h.orig Mon Jun 7 18:00:36 2010 ++++ src/ctf/g_local.h Mon Jun 7 18:01:30 2010 +@@ -514,10 +514,11 @@ extern int meansOfDeath; + + extern edict_t *g_edicts; + +-#define FOFS(x) (int)&(((edict_t *)0)->x) +-#define STOFS(x) (int)&(((spawn_temp_t *)0)->x) +-#define LLOFS(x) (int)&(((level_locals_t *)0)->x) +-#define CLOFS(x) (int)&(((gclient_t *)0)->x) ++#include ++#define FOFS(x) offsetof(edict_t, x) ++#define STOFS(x) offsetof(spawn_temp_t, x) ++#define LLOFS(x) offsetof(level_locals_t, x) ++#define CLOFS(x) offsetof(gclient_t, x) + + #define random() ((rand () & 0x7fff) / ((float)0x7fff)) + #define crandom() (2.0 * (random() - 0.5)) diff --git a/games/quake2/patches/patch-src_sv_world_c b/games/quake2/patches/patch-src_sv_world_c new file mode 100644 index 00000000000..fda4a61426b --- /dev/null +++ b/games/quake2/patches/patch-src_sv_world_c @@ -0,0 +1,17 @@ +$OpenBSD: patch-src_sv_world_c,v 1.1 2010/06/07 16:03:40 espie Exp $ +--- src/sv_world.c.orig Mon Jun 7 17:49:42 2010 ++++ src/sv_world.c Mon Jun 7 17:56:40 2010 +@@ -30,10 +30,12 @@ FIXME: this use of "area" is different from the bsp fi + =============================================================================== + */ + ++#include ++ + // (type *)STRUCT_FROM_LINK(link_t *link, type, member) + // ent = STRUCT_FROM_LINK(link,entity_t,order) + // FIXME: remove this mess! +-#define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - (int)&(((t *)0)->m))) ++#define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - offsetof(t, m))) + + #define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l,edict_t,area) +