90d29551f7
roll-your-own offsetof, disgusting. fix on LP64 + gcc4
20 lines
733 B
Plaintext
20 lines
733 B
Plaintext
$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 <stddef.h>
|
|
+#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))
|