Date: Thu, 6 Sep 2007 10:55:43 GMT From: Scot Hetzel <swhetzel@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/116149: games/uox3 fails to build with gcc 4.2 Message-ID: <200709061055.l86Ath1L091800@www.freebsd.org> Resent-Message-ID: <200709061100.l86B08Nd055788@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 116149 >Category: ports >Synopsis: games/uox3 fails to build with gcc 4.2 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 06 11:00:08 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Scot Hetzel >Release: 7.0-Current >Organization: >Environment: FreeBSD hp010 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed Sep 5 11:17:27 CDT 2007 swhetzel@hp010:/usr/src/7x/sys-p4/amd64/compile/GENERIC.debug amd64 >Description: The port fails to build due to the minimum/maximum operators ( <?, >?, ...) have been removed in GCC 4.2. >How-To-Repeat: cd /usr/ports/games/uox3 make build : c++ -c -O2 -fno-strict-aliasing -pipe -march=k8 -w -funsigned-char -fconserve-space magic.cpp -o magic.o magic.cpp: In function 'void healtarget(int)': magic.cpp:1287: error: expected primary-expression before '?' token magic.cpp:1287: error: expected `:' before ';' token magic.cpp:1287: error: expected primary-expression before ';' token magic.cpp: In function 'void greaterhealtarget(int)': magic.cpp:1314: error: expected primary-expression before '?' token magic.cpp:1314: error: expected `:' before ';' token magic.cpp:1314: error: expected primary-expression before ';' token magic.cpp: In function 'void magicdamage(int, int)': magic.cpp:2358: error: expected primary-expression before '?' token magic.cpp:2358: error: expected `:' before ';' token magic.cpp:2358: error: expected primary-expression before ';' token magic.cpp: In function 'void directdamage(int, int)': magic.cpp:2988: error: expected primary-expression before '?' token magic.cpp:2988: error: expected `:' before ';' token magic.cpp:2988: error: expected primary-expression before ';' token gmake[1]: *** [magic.o] Error 1 >Fix: The attached patch removes the broken state for -CURRENT and updates files/patch-al to allow the min/max macros in work/dev/uox3.h to compile with GCC 4.2. Patch attached with submission follows: Index: Makefile =================================================================== RCS file: /home/ncvs/ports/games/uox3/Makefile,v retrieving revision 1.18 diff -u -r1.18 Makefile --- Makefile 2 Jul 2007 19:01:00 -0000 1.18 +++ Makefile 6 Sep 2007 10:44:56 -0000 @@ -28,10 +28,6 @@ .include <bsd.port.pre.mk> -.if ${OSVERSION} >= 700042 -BROKEN= Does not compile with GCC 4.2 -.endif - do-build: cd ${WRKSRC}/dev && ${GMAKE} -f ${MAKEFILE} CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" ${ALL_TARGET} Index: files/patch-al =================================================================== RCS file: /home/ncvs/ports/games/uox3/files/patch-al,v retrieving revision 1.1 diff -u -r1.1 patch-al --- files/patch-al 27 Feb 2000 23:12:14 -0000 1.1 +++ files/patch-al 6 Sep 2007 10:41:27 -0000 @@ -1,5 +1,5 @@ ---- work/dev/uox3.h.orig Sun Feb 14 18:56:03 1999 -+++ work/dev/uox3.h Sun Feb 27 11:28:45 2000 +--- work/dev/uox3.h.orig 1999-02-14 18:56:03.000000000 -0600 ++++ work/dev/uox3.h 2007-09-06 05:37:55.229539705 -0500 @@ -3,10 +3,10 @@ //#define VER "0.69.02 (Test Build 03)" //Increment to 01 when putting out official test build #define PRODUCT "Ultima Offline eXperiment 3" @@ -42,6 +42,17 @@ #endif #include "im.h" #include "uoxlist.h" +@@ -51,8 +57,8 @@ + #include "worldmain.h" + // LINUX Definitions + #ifndef __NT__ +-#define max(a,b) (a) >? (b) +-#define min(a,b) (a) <? (b) ++#define max(a,b) ((a) >= (b) ? (a) : (b)) ++#define min(a,b) ((a) <= (b) ? (a) : (b)) + char *strlwr(char *); + char *strupr(char *); + #endif @@ -349,7 +355,7 @@ unsigned long int regen, regen2, regen3; int runenumb; // Used for naming runes >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709061055.l86Ath1L091800>