freebsd-ports/games/jfk/files/patch-src__lib__network.cc
William Grzybowski c4cbfa3b76 games/jfk: fix build with clang
PR:		ports/184244
Submitted by:	KATO Tsuguru <tkato432 yahoo.com>
2013-11-30 11:08:26 +00:00

27 lines
797 B
C++

--- 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();