From a2ae5368c1293cd56ce3c32056f36c603a068a5e Mon Sep 17 00:00:00 2001
From: Will Andrews <will@FreeBSD.org>
Date: Tue, 20 Mar 2007 20:11:49 +0000
Subject: Fix compilation when using gcc 4.1 due to attempting to cast a
 pointer to an int, which may lose precision on platforms where sizeof(void*)
 > sizeof(int). Properly support overriding CC/CXX, which is a prerequisite
 for fixing this.

Noticed by:	pointyhat/kris
---
 games/xkobo/Makefile       | 4 ++++
 games/xkobo/files/patch-af | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

(limited to 'games')

diff --git a/games/xkobo/Makefile b/games/xkobo/Makefile
index 6eae33de7b49..44018bd64d0e 100644
--- a/games/xkobo/Makefile
+++ b/games/xkobo/Makefile
@@ -19,6 +19,10 @@ USE_IMAKE=	yes
 ALL_TARGET=	xkobo
 MAN1=		xkobo.1
 
+post-configure:
+	${REINPLACE_CMD} -E -e 's,^.* CC = .*$$, CC=${CC},' \
+			    -e 's,^.* CXX = .*$$, CXX=${CXX},' ${WRKSRC}/Makefile
+
 post-install:
 	${CHMOD} u-s,g+s ${PREFIX}/bin/xkobo
 	${CHOWN} root:games ${PREFIX}/bin/xkobo ${PREFIX}/lib/X11/xkobo-scores
diff --git a/games/xkobo/files/patch-af b/games/xkobo/files/patch-af
index 1db897a8ebf4..2bd42624e7b3 100644
--- a/games/xkobo/files/patch-af
+++ b/games/xkobo/files/patch-af
@@ -5,7 +5,7 @@
              break;
          }
 -        t += i;
-+        t = (void *) ((int) t + i);
++        t = (void *) ((long) t + i);
          len -= i;
      } while (len > 0);
      for (;;){
@@ -14,7 +14,7 @@
              break;
          }
 -        t += i;
-+        t = (void *) ((int) t + i);
++        t = (void *) ((long) t + i);
          len -= i;
      } while (len > 0);
      for (;;){
-- 
cgit v1.2.3