Permalink
Browse files

games/jfk: fix build with clang

PR:		ports/184244
Submitted by:	KATO Tsuguru <tkato432 yahoo.com>
  • Loading branch information...
1 parent c685654 commit b759ad7663428fa6563a21ee370c1f7ea31201f6 @william-gr william-gr committed Nov 30, 2013
View
@@ -8,7 +8,6 @@ CATEGORIES= games
MASTER_SITES= http://hop.at/jfk/
LICENSE= GPLv2 # (or later)
-LICENSE_FILE= ${WRKSRC}/COPYING
MAINTAINER= ports@FreeBSD.org
COMMENT= Multiplayer 2D shoot'em up game
@@ -0,0 +1,10 @@
+--- src/client/objects_c.cc.orig
++++ src/client/objects_c.cc
+@@ -21,6 +21,7 @@
+ */
+
+ #include <cmath>
++#include <cstdlib>
+ #include <string>
+ #include "objects_c.h"
+ #include "level.h"
@@ -0,0 +1,27 @@
+--- src/lib/network.cc.orig
++++ src/lib/network.cc
+@@ -6,6 +6,7 @@
+ #include <cassert>
+ #include <cerrno>
+ #include <csignal>
++#include <cstdlib>
+ #include <cstring>
+ #include <new>
+ #include <string>
+@@ -289,7 +290,7 @@
+
+ set_socket_nonblocking(listenfd);
+
+- sa = (sockaddr*)std::malloc(MAXSOCKADDR);
++ sa = (sockaddr*)malloc(MAXSOCKADDR);
+ if (sa == NULL)
+ throw std::bad_alloc();
+ }
+@@ -370,7 +371,7 @@
+ const size_t MIN_POLLFD = 10;
+ /* allocate more memory for the pollfd array */
+ fd_alloc = std::max(MIN_POLLFD, 3 * fd_alloc / 2);
+- pollfd* tmp = (pollfd*)std::realloc(fds, fd_alloc * sizeof *fds);
++ pollfd* tmp = (pollfd*)realloc(fds, fd_alloc * sizeof *fds);
+ if (tmp == NULL)
+ throw std::bad_alloc();

0 comments on commit b759ad7

Please sign in to comment.