aboutsummaryrefslogtreecommitdiffstats
path: root/games/rtb
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2004-09-22 13:47:15 +0800
committerdanfe <danfe@FreeBSD.org>2004-09-22 13:47:15 +0800
commit98ba5f1abddbe98621721b0fabb751081da80688 (patch)
tree19261bf6b6913a372988695c1daf9fa0913a3b28 /games/rtb
parent138f567083c5e2627069dd01679aa6756320e0a5 (diff)
downloadfreebsd-ports-gnome-98ba5f1abddbe98621721b0fabb751081da80688.tar.gz
freebsd-ports-gnome-98ba5f1abddbe98621721b0fabb751081da80688.tar.zst
freebsd-ports-gnome-98ba5f1abddbe98621721b0fabb751081da80688.zip
Fix bad C++ code to unbreak the build with latest GCC.
Reported by: kris Approved by: portmgr (marcus), fjoe (mentor, implicit)
Diffstat (limited to 'games/rtb')
-rw-r--r--games/rtb/Makefile11
-rw-r--r--games/rtb/files/patch-include::List.h29
-rw-r--r--games/rtb/files/patch-src::GeometricalObjects.cc47
-rw-r--r--games/rtb/files/patch-src::StartTournamentWindow.cc20
4 files changed, 101 insertions, 6 deletions
diff --git a/games/rtb/Makefile b/games/rtb/Makefile
index e1e13d6f03e5..2ad1d9e9f9cb 100644
--- a/games/rtb/Makefile
+++ b/games/rtb/Makefile
@@ -22,6 +22,7 @@ USE_GNOME= gnometarget gtk20 lthack
USE_GETOPT_LONG= yes
USE_GMAKE= yes
USE_LIBTOOL_VER=13
+USE_REINPLACE= yes
CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
MAKE_ARGS= ACLOCAL="${TRUE}" AUTOCONF="${TRUE}" AUTOMAKE="${TRUE}" \
AUTOHEADER="${TRUE}"
@@ -29,11 +30,9 @@ MAKE_ARGS= ACLOCAL="${TRUE}" AUTOCONF="${TRUE}" AUTOMAKE="${TRUE}" \
CPPFLAGS= -I${LOCALBASE}/include -DHAVE_DECL_GETOPT
LDFLAGS= -L${LOCALBASE}/lib
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 502126
-BROKEN= "Does not compile on FreeBSD >= 5.x"
-.endif
+post-extract:
+ @${REINPLACE_CMD} -e 's/min/Min/; s/max/Max/' ${WRKSRC}/include/Various.h
+ @${REINPLACE_CMD} -E -e 's/\(int\*\)/int\*/' ${WRKSRC}/src/ArenaRealTime.cc
post-install:
.if !defined(NOPORTDOCS)
@@ -43,4 +42,4 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/doc/RealTimeBattle.txt ${DOCSDIR}
.endif
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/games/rtb/files/patch-include::List.h b/games/rtb/files/patch-include::List.h
new file mode 100644
index 000000000000..324c09e88897
--- /dev/null
+++ b/games/rtb/files/patch-include::List.h
@@ -0,0 +1,29 @@
+--- include/List.h.orig Tue Sep 21 15:50:15 2004
++++ include/List.h Tue Sep 21 17:22:32 2004
+@@ -96,7 +96,7 @@
+ inline T*
+ ListIterator<T>::operator() () const
+ {
+- if ( listp == NULL ) Error(true, "NULL pointer", "ListIterator::operator()");
++ if ( listp == NULL ) Error(true, (const String&)"NULL pointer", (const String&)"ListIterator::operator()");
+
+ return listp->element;
+ }
+@@ -105,7 +105,7 @@
+ inline const ListIterator<T>&
+ ListIterator<T>::operator++ (int)
+ {
+- if ( listp == NULL ) Error(true, "NULL pointer", "ListIterator::operator++");
++ if ( listp == NULL ) Error(true, (const String&)"NULL pointer", (const String&)"ListIterator::operator++");
+ listp = listp->next;
+ return *this;
+ }
+@@ -114,7 +114,7 @@
+ inline const ListIterator<T>&
+ ListIterator<T>::operator-- (int)
+ {
+- if ( listp == NULL ) Error(true, "NULL pointer", "ListIterator::operator--");
++ if ( listp == NULL ) Error(true, (const String&)"NULL pointer", (const String&)"ListIterator::operator--");
+ listp = listp->prev;
+ return *this;
+ }
diff --git a/games/rtb/files/patch-src::GeometricalObjects.cc b/games/rtb/files/patch-src::GeometricalObjects.cc
new file mode 100644
index 000000000000..0a1802159038
--- /dev/null
+++ b/games/rtb/files/patch-src::GeometricalObjects.cc
@@ -0,0 +1,47 @@
+--- src/GeometricalObjects.cc.orig Tue Sep 21 18:01:56 2004
++++ src/GeometricalObjects.cc Tue Sep 21 18:02:43 2004
+@@ -89,7 +89,7 @@
+ if( s < 0 || s > length ) return infinity;
+ if( t < 0 && ((d=-dot(y, direction)) < 0.0 || d > length ) ) return infinity;
+
+- return max(t, 0);
++ return Max(t, 0);
+ }
+
+ Vector2D
+@@ -169,7 +169,7 @@
+ double r = size+radius;
+ double c = dt*dt + speedsqr * (r*r - lengthsqr(y));
+ if( c < 0.0 || dt <= 0.0) return infinity;
+- return max( (dt - sqrt(c))/speedsqr, 0);
++ return Max( (dt - sqrt(c))/speedsqr, 0);
+ }
+
+ bool
+@@ -231,7 +231,7 @@
+ if( speedsqr == 0.0 ) return infinity;
+ double dt = dot(vel, y);
+ double c = dt*dt + speedsqr*((size-radius)*(size-radius) - lengthsqr(y));
+- return max( (dt + sqrt(c))/speedsqr, 0 );
++ return Max( (dt + sqrt(c))/speedsqr, 0 );
+ }
+
+ bool
+@@ -318,7 +318,7 @@
+ r = size + outer_radius;
+ c = dt*dt + speedsqr * (r*r - lengthsqr(d));
+ if( c < 0.0 || dt <= 0.0) return infinity;
+- t = max( (dt - sqrt(c))/speedsqr, 0);
++ t = Max( (dt - sqrt(c))/speedsqr, 0);
+
+ if( within_angle( vec2angle( vel * t - d ) ) )
+ return t;
+@@ -336,7 +336,7 @@
+ c = dt*dt + speedsqr*( r*r - lengthsqr(d) );
+ if( c < 0.0 ) return infinity; // Can happen if object outside circle
+
+- t = max( (dt + sqrt(c))/speedsqr, 0 );
++ t = Max( (dt + sqrt(c))/speedsqr, 0 );
+
+ if( !within_angle( vec2angle( vel * t - d ) ) )
+ return infinity;
diff --git a/games/rtb/files/patch-src::StartTournamentWindow.cc b/games/rtb/files/patch-src::StartTournamentWindow.cc
new file mode 100644
index 000000000000..840ac3db971f
--- /dev/null
+++ b/games/rtb/files/patch-src::StartTournamentWindow.cc
@@ -0,0 +1,20 @@
+--- src/StartTournamentWindow.cc.orig Tue Sep 21 18:05:42 2004
++++ src/StartTournamentWindow.cc Tue Sep 21 18:06:01 2004
+@@ -660,7 +660,7 @@
+ max_value = 10000;
+ else
+ {
+- max_value = min( the_opts.get_l( OPTION_MAX_ROBOTS_ALLOWED ),robot_number);
++ max_value = Min( the_opts.get_l( OPTION_MAX_ROBOTS_ALLOWED ),robot_number);
+ }
+ if(i != 1)
+ min_value = 1;
+@@ -805,7 +805,7 @@
+ max_value = 10000;
+ else
+ {
+- max_value = min(the_opts.get_l( OPTION_MAX_ROBOTS_ALLOWED ),robot_number);
++ max_value = Min(the_opts.get_l( OPTION_MAX_ROBOTS_ALLOWED ),robot_number);
+ }
+ if(i != 1)
+ min_value = 1;