aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2004-10-03 21:49:13 +0800
committerdanfe <danfe@FreeBSD.org>2004-10-03 21:49:13 +0800
commitce3a58013222158b368367e6bcc9639d355ae4ab (patch)
treea4022d3758802236168bf00d48340115f74b349e
parent141dc7e6bd7f0c41d023013f6c0dd8b5373aabad (diff)
downloadfreebsd-ports-gnome-ce3a58013222158b368367e6bcc9639d355ae4ab.tar.gz
freebsd-ports-gnome-ce3a58013222158b368367e6bcc9639d355ae4ab.tar.zst
freebsd-ports-gnome-ce3a58013222158b368367e6bcc9639d355ae4ab.zip
Fix the build with recent GCC.
Reported by: kris Approved by: portmgr (krion) fjoe (mentor, implicit) blackend (maintainer)
-rw-r--r--games/xarchon/Makefile8
-rw-r--r--games/xarchon/files/patch-src::Genetic.hpp33
-rw-r--r--games/xarchon/files/patch-src::Problem.hpp50
3 files changed, 84 insertions, 7 deletions
diff --git a/games/xarchon/Makefile b/games/xarchon/Makefile
index e1c5b6d32bbe..e3ae05dffa6c 100644
--- a/games/xarchon/Makefile
+++ b/games/xarchon/Makefile
@@ -25,14 +25,8 @@ USE_REINPLACE= yes
MAN6= xarchon.6
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 502126
-BROKEN= "Does not compile on FreeBSD >= 5.x"
-.endif
-
post-patch:
@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/games/xarchon/files/patch-src::Genetic.hpp b/games/xarchon/files/patch-src::Genetic.hpp
new file mode 100644
index 000000000000..76cfb1fc1e89
--- /dev/null
+++ b/games/xarchon/files/patch-src::Genetic.hpp
@@ -0,0 +1,33 @@
+--- src/Genetic.hpp.orig Fri Oct 1 10:06:20 2004
++++ src/Genetic.hpp Fri Oct 1 10:08:12 2004
+@@ -216,9 +216,9 @@
+ virtual Genetic_Operator<T> *Choose_Operator(void)
+ {
+ int max=(int)total_op_weight;
+- list<Genetic_Operator<T> *>::iterator start=operators.begin();
+- list<Genetic_Operator<T> *>::iterator end=operators.end();
+- list<Genetic_Operator<T> *>::iterator iter;
++ typename list<Genetic_Operator<T> *>::iterator start=operators.begin();
++ typename list<Genetic_Operator<T> *>::iterator end=operators.end();
++ typename list<Genetic_Operator<T> *>::iterator iter;
+ int r=rand()%max;
+ int count=0;
+ for (iter=start;iter!=end;iter++) {
+@@ -249,7 +249,7 @@
+ Genetic_Population<T> *newpop=new Genetic_Population<T>(p->size);
+ int cur_size=0;
+ while (cur_size<newpop->size) {
+- Genetic_Operator<T> *op=Choose_Operator();
++ Genetic_Operator<T> *op=this->Choose_Operator();
+ if ( (cur_size+op->NumOfResults())>newpop->size)
+ continue;
+ for (i=0;i<op->NumOfOperands();i++) {
+@@ -264,7 +264,7 @@
+ cur_size++;
+ }
+ }
+- newpop->Eval_Fitness(fit_func);
++ newpop->Eval_Fitness(this->fit_func);
+ return newpop;
+ }
+
diff --git a/games/xarchon/files/patch-src::Problem.hpp b/games/xarchon/files/patch-src::Problem.hpp
new file mode 100644
index 000000000000..2a26756dd064
--- /dev/null
+++ b/games/xarchon/files/patch-src::Problem.hpp
@@ -0,0 +1,50 @@
+--- src/Problem.hpp.orig Fri Oct 1 10:00:09 2004
++++ src/Problem.hpp Fri Oct 1 10:05:48 2004
+@@ -306,14 +306,14 @@
+ virtual G Goal_Value(T *a)
+ {
+ if (depth==0)
+- return tester->Goal_Value(a);
++ return this->tester->Goal_Value(a);
+
+- Goal_Test<G,T> *endtester=tester;
+- tester=new Minimax_Goal_Test(depth-1,generator,other_acc,goal_acc,tester);
++ Goal_Test<G,T> *endtester=this->tester;
++ this->tester=new Minimax_Goal_Test(depth-1,this->generator,other_acc,this->goal_acc,this->tester);
+ G ret_val=Successor_Goal_Test<G,T>::Goal_Value(a);
+- delete tester;
+- tester=endtester;
+- delete next;
++ delete this->tester;
++ this->tester=endtester;
++ delete this->next;
+
+ return ret_val;
+ }
+@@ -340,19 +340,19 @@
+
+ virtual G Goal_Value(T *a)
+ {
+- Goal_Accumulator <G,T> *old=goal_acc;
++ Goal_Accumulator <G,T> *old=this->goal_acc;
+ Multi_Goal_Accumulator <G,T,greater<G> > *mga=new Multi_Goal_Accumulator<G,T,greater<G> >(branch);
+- goal_acc=mga;
++ this->goal_acc=mga;
+ Successor_Goal_Test<G,T>::Goal_Value(a);
+- goal_acc=old;
++ this->goal_acc=old;
+ for (mga->Init();!mga->IsEnd();mga->Next()) {
+ T *state=mga->Get_State();
+- Multi_Minimax_Goal_Test *next=new Multi_Minimax_Goal_Test(d-1,b,gen,other,goal_acc,tester);
++ Multi_Minimax_Goal_Test *next=new Multi_Minimax_Goal_Test(this->d-1,this->b,this->gen,other,this->goal_acc,this->tester);
+ next->Goal_Value(state);
+- goal_acc->Put(accumulator->value,acc->state,acc->op);
++ this->goal_acc->Put(this->accumulator->value,this->acc->state,this->acc->op);
+ }
+- goal_acc->Put(mga->Get_State(),mga->Get_Operator(),mga->Get_Result());
+- return goal_acc->Get_Value();
++ this->goal_acc->Put(mga->Get_State(),mga->Get_Operator(),mga->Get_Result());
++ return this->goal_acc->Get_Value();
+ }
+ };
+