- Fix the build on 64-bit arches [1]

- Minor cosmetic Makefile nits

Tested on:	amd64 [1]
Reported by:	pointyhat (logs) [1]
This commit is contained in:
Alexey Dokuchaev 2007-09-07 10:13:01 +00:00
parent c7ebccf83a
commit 5a6f00f474
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=199015
2 changed files with 97 additions and 6 deletions

View file

@ -20,12 +20,13 @@ COMMENT= Fast, stable, compatible, and secure Quake II client
USE_BZIP2= yes
USE_SDL= sdl
USE_GL= yes
USE_DOS2UNIX= src/vanctf/g_local.h
GNU_CONFIGURE= yes
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib" \
OPENGL_CFLAGS="-I${X11BASE}/include" OPENGL_LIBS="-L${X11BASE}/lib"
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
LIBDIR= ${PREFIX}/lib/${PORTNAME}
PLIST_SUB+= LIBDIR="${LIBDIR:S/${PREFIX}\///}"
@ -40,16 +41,11 @@ OPTIONS= GAME "Build a main game .so file" off \
.include <bsd.port.pre.mk>
.if ${ARCH} != "i386"
BROKEN= Does not compile on !i386
.endif
.if !defined(WITHOUT_GAME)
PLIST_SUB+= GAME=""
Q2GAMES+= baseq2
.else
PLIST_SUB+= GAME="@comment "
Q2GAMES_NOT+= baseq2
.endif
.if defined(WITH_CTF)

View file

@ -0,0 +1,95 @@
--- src/baseq2/g_local.h.orig 2007-01-13 06:07:33.000000000 +0600
+++ src/baseq2/g_local.h 2007-09-07 12:51:49.000000000 +0700
@@ -500,10 +500,11 @@
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 <inttypes.h>
+#define FOFS(x)(intptr_t)&(((edict_t *)0)->x)
+#define STOFS(x)(intptr_t)&(((spawn_temp_t *)0)->x)
+#define LLOFS(x)(intptr_t)&(((level_locals_t *)0)->x)
+#define CLOFS(x)(intptr_t)&(((gclient_t *)0)->x)
#define random() ((rand() & 0x7fff) /((float)0x7fff))
#define crandom() (2.0 *(random() - 0.5))
--- src/ctf/g_local.h.orig 2007-01-13 06:07:33.000000000 +0600
+++ src/ctf/g_local.h 2007-09-07 13:03:31.000000000 +0700
@@ -509,10 +509,11 @@
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 <inttypes.h>
+#define FOFS(x)(intptr_t)&(((edict_t *)0)->x)
+#define STOFS(x)(intptr_t)&(((spawn_temp_t *)0)->x)
+#define LLOFS(x)(intptr_t)&(((level_locals_t *)0)->x)
+#define CLOFS(x)(intptr_t)&(((gclient_t *)0)->x)
#define random() ((rand() & 0x7fff) /((float)0x7fff))
#define crandom() (2.0 *(random() - 0.5))
--- src/qmass/g_local.h.orig 2007-01-13 06:07:31.000000000 +0600
+++ src/qmass/g_local.h 2007-09-07 13:02:58.000000000 +0700
@@ -486,10 +486,11 @@
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 <inttypes.h>
+#define FOFS(x)(intptr_t)&(((edict_t *)0)->x)
+#define STOFS(x)(intptr_t)&(((spawn_temp_t *)0)->x)
+#define LLOFS(x)(intptr_t)&(((level_locals_t *)0)->x)
+#define CLOFS(x)(intptr_t)&(((gclient_t *)0)->x)
#define random() ((rand() & 0x7fff) / ((float)0x7fff))
#define crandom() (2.0 * (random() - 0.5))
--- src/sv_world.c.orig 2007-01-13 06:07:33.000000000 +0600
+++ src/sv_world.c 2007-09-07 12:35:05.000000000 +0700
@@ -35,7 +35,8 @@
//(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)))
+#include <inttypes.h>
+#define STRUCT_FROM_LINK(l,t,m)((t *)((byte *)l -(intptr_t)&(((t *)0)->m)))
#define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l,edict_t,area)
--- src/vanctf/g_local.h.orig 2007-09-07 13:15:50.000000000 +0700
+++ src/vanctf/g_local.h 2007-09-07 12:51:22.000000000 +0700
@@ -512,10 +512,11 @@
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 <inttypes.h>
+#define FOFS(x) (intptr_t)&(((edict_t *)0)->x)
+#define STOFS(x) (intptr_t)&(((spawn_temp_t *)0)->x)
+#define LLOFS(x) (intptr_t)&(((level_locals_t *)0)->x)
+#define CLOFS(x) (intptr_t)&(((gclient_t *)0)->x)
#define random() ((rand () & 0x7fff) / ((float)0x7fff))
#define crandom() (2.0 * (random() - 0.5))
--- src/vanctf/p_client.c.orig 2007-01-13 06:07:32.000000000 +0600
+++ src/vanctf/p_client.c 2007-09-07 13:07:22.000000000 +0700
@@ -1727,7 +1727,7 @@
if(level.time - ent->client->resp.lastmovetime > antiidle->value*60){
char buff[256];
gi.cprintf(ent, PRINT_HIGH, "You were removed for remaining idle too long\n");
- sprintf(buff, "kick %d\n", (ent - g_edicts) - 1);
+ sprintf(buff, "kick %ld\n", (long int)(ent - g_edicts) - 1);
gi.AddCommandString(buff);
} else if(fabs(level.time - ent->client->resp.lastmovetime - (antiidle->value - 1) * 60) < 0.025){
gi.centerprintf(ent, "You can't remain idle on this server.\n\nYou have 1 minute before\nyou will be kicked!\n");