Fixed build on 7.x

Removed dependency on gcc2.95
This commit is contained in:
Edwin Groothuis 2009-02-22 04:05:02 +00:00
parent 4dd16db242
commit 3669dacd4a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=228813
7 changed files with 126 additions and 74 deletions

View file

@ -8,7 +8,7 @@
PORTNAME= xrally
PORTVERSION= 1.1.1
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= games
MASTER_SITES= SF/xrally
DISTNAME= ${PORTNAME}-1.1
@ -17,8 +17,6 @@ MAINTAINER= edwin@mavetju.org
COMMENT= XRally is a Linux clone of the classic Rally X arcade game
WRKSRC= ${WRKDIR}/${PORTNAME}
USE_GCC= 2.95
PTHREAD_LIBS= -lc_r
HAS_CONFIGURE= yes
USE_XORG= x11 xi xpm
USE_BZIP2= yes
@ -29,10 +27,4 @@ CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}" \
MAKE_ENV= LDFLAGS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}" \
INCLUDES="-I${LOCALBASE}/include"
.include <bsd.port.pre.mk>
.if ${OSVERSION} > 700000
BROKEN= Doesn't work (yet?) on 7.x
.endif
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -0,0 +1,42 @@
--- global.h.orig 2001-01-02 05:49:16.000000000 +1100
+++ global.h 2009-02-22 13:18:18.000000000 +1100
@@ -5,7 +5,7 @@
copyright : (C) 2000 by Perdig
email : perdig@linuxbr.com.br
- $Id: global.h,v 1.9 2001/01/01 18:49:16 perdig Exp $
+ $Id: global.h,v 1.10 2001/01/11 15:28:03 perdig Exp $
***************************************************************************/
/***************************************************************************
@@ -181,10 +181,12 @@
#define _D_INFO "\x1b[33m"
#define _D_CRIT "\x1b[31m"
#define _D_WARN "\x1b[36m"
-#define _D(args...) do { \
- printf("\x1b[33m" __PRETTY_FUNCTION__ " \x1b[37m[" __FILE__ \
- ":%d] " _D_INFO, __LINE__); printf (args); printf ("\x1b[0m\n"); \
- } while (0)
+#define _D(args...) { \
+ printf("\x1b[33m%s \x1b[37m[%s:%d]%s", \
+ __PRETTY_FUNCTION__, __FILE__, __LINE__, _D_INFO); \
+ printf(args); \
+ printf("\x1b[0m\n"); \
+ }
#define ldbg(STR...) { if (DEBUG&4) _D(_D_INFO STR); }
#define dbg(STR...) { if (DEBUG&2) _D(_D_WARN STR); }
@@ -213,4 +215,13 @@
#define PLAYABLE
+#ifndef USE_SOUND
+#define sound_switch()
+#define sound_stop()
+#define sound_volume(a)
+#define sound_start()
+#define sound_select(a)
+#define sound_load(a)
+#endif
+
#endif

View file

@ -1,59 +1,39 @@
--- menu.c 2001/01/01 18:49:16 1.22 XRALLY_1_1
+++ menu.c 2001/01/11 15:28:03 1.23 HEAD
--- graphics.c.orig 2000-12-09 04:42:47.000000000 +1100
+++ graphics.c 2009-02-22 14:41:51.000000000 +1100
@@ -5,7 +5,7 @@
copyright : (C) 2000 by Perdig
email : perdig@linuxbr.com.br
- $Id: menu.c,v 1.22 2001/01/01 18:49:16 perdig Exp $
+ $Id: menu.c,v 1.23 2001/01/11 15:28:03 perdig Exp $
***************************************************************************/
/***************************************************************************
@@ -25,7 +25,9 @@
#include "level.h"
#include "score.h"
#include "dirent.h"
+#ifdef USE_SOUND
#include "sound.h"
+#endif
#include "limits.h"
#include <stdio.h>
#include <string.h>
--- graphics.c 2000/12/07 12:44:10 1.15 XRALLY_1_1
+++ graphics.c 2001/01/11 15:28:03 1.16 HEAD
@@ -5,7 +5,7 @@
copyright : (C) 2000 by Perdig
email : perdig@linuxbr.com.br
- $Id: graphics.c,v 1.15 2000/12/07 12:44:10 perdig Exp $
+ $Id: graphics.c,v 1.16 2001/01/11 15:28:03 perdig Exp $
***************************************************************************/
/***************************************************************************
@@ -18,12 +18,13 @@
@@ -18,12 +18,14 @@
***************************************************************************/
#include "graphics.h"
#include "global.h"
+#include <unistd.h>
+#include <string.h>
#include <sys/time.h>
// Internal functions
static char ** _split_text(const char *_txt);
-static int _check_event(XEvent *xev);
+static int _check_event(XEvent *xev, int blocking);
long time_diff(struct timeval *rt);
// Basic X11 variables
@@ -401,10 +402,15 @@
@@ -401,10 +403,15 @@
return double_buffer;
}
-static int _check_event(XEvent *xev) {
+static int _check_event(XEvent *xev, int blocking) {
XEvent *last = NULL;
+ int a = 0;
- while (XCheckMaskEvent(dpy, KeyPressMask | ExposureMask, xev)) {
+ do {
+ if (blocking)
@ -63,7 +43,7 @@
switch (xev->type) {
case KeyPress:
last = xev;
@@ -417,7 +423,7 @@
@@ -417,7 +424,7 @@
default:
break;
}
@ -72,8 +52,8 @@
// No events
xev = last;
return (last) ? true : false;
@@ -426,32 +432,35 @@
@@ -426,32 +433,35 @@
KeySym check_key() {
XEvent xev;
- if (_check_event(&xev) && xev.type == KeyPress)
@ -82,7 +62,7 @@
// No events
return XK_VoidSymbol;
}
KeySym wait_key() {
- KeySym key = XK_VoidSymbol;
- while (key == XK_VoidSymbol) {
@ -93,7 +73,7 @@
+ _check_event(&xev, 1);
+ return XLookupKeysym(&xev.xkey, 0);
}
void wait_time(long time_wait) {
- struct timeval it;
+ struct timeval it, tmp;
@ -109,7 +89,7 @@
+ _check_event(&xev, 0);
+ }
}
KeySym wait_char(char *str) {
KeySym key = XK_VoidSymbol;
XEvent xev;
@ -118,29 +98,3 @@
XLookupString(&xev.xkey, str, 3, &key, NULL);
return key;
}
--- global.h 2001/01/01 18:49:16 1.9 XRALLY_1_1
+++ global.h 2001/01/11 15:28:03 1.10
@@ -5,7 +5,7 @@
copyright : (C) 2000 by Perdig
email : perdig@linuxbr.com.br
- $Id: global.h,v 1.9 2001/01/01 18:49:16 perdig Exp $
+ $Id: global.h,v 1.10 2001/01/11 15:28:03 perdig Exp $
***************************************************************************/
/***************************************************************************
@@ -212,5 +212,14 @@
#define PLAYABLE
+
+#ifndef USE_SOUND
+#define sound_switch()
+#define sound_stop()
+#define sound_volume(a)
+#define sound_start()
+#define sound_select(a)
+#define sound_load(a)
+#endif
#endif

View file

@ -0,0 +1,21 @@
--- menu.c 2001/01/01 18:49:16 1.22 XRALLY_1_1
+++ menu.c 2001/01/11 15:28:03 1.23 HEAD
@@ -5,7 +5,7 @@
copyright : (C) 2000 by Perdig
email : perdig@linuxbr.com.br
- $Id: menu.c,v 1.22 2001/01/01 18:49:16 perdig Exp $
+ $Id: menu.c,v 1.23 2001/01/11 15:28:03 perdig Exp $
***************************************************************************/
/***************************************************************************
@@ -25,7 +25,9 @@
#include "level.h"
#include "score.h"
#include "dirent.h"
+#ifdef USE_SOUND
#include "sound.h"
+#endif
#include "limits.h"
#include <stdio.h>
#include <string.h>

View file

@ -0,0 +1,10 @@
--- score.c.orig 2009-02-22 14:37:44.000000000 +1100
+++ score.c 2009-02-22 14:37:54.000000000 +1100
@@ -17,6 +17,7 @@
* *
***************************************************************************/
+#include <string.h>
#include "config.h"
#include "score.h"
#include "time.h"

View file

@ -0,0 +1,18 @@
--- sound.c.orig 2009-02-22 14:43:06.000000000 +1100
+++ sound.c 2009-02-22 15:00:36.000000000 +1100
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -563,6 +564,7 @@
}
skip_extended:
+ while (0) {};
} else {
/*
* In the rest of the frames we slide volume, pitch,

View file

@ -0,0 +1,15 @@
--- soundplayer.h.orig 2009-02-22 14:46:33.000000000 +1100
+++ soundplayer.h 2009-02-22 14:59:51.000000000 +1100
@@ -103,9 +103,9 @@
#define vphase data[2]
#define target data[0]
-#define fx_enable(x) do { x##.active = 1; } while (0)
-#define fx_disable(x) do { x##.active = 0; } while (0)
-#define fx_test(x) (x##.active != 0)
+#define fx_enable(x) do { x.active = 1; } while (0)
+#define fx_disable(x) do { x.active = 0; } while (0)
+#define fx_test(x) (x.active != 0)
/* Sound driver stuff */