aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorjbeich <jbeich@FreeBSD.org>2018-01-26 23:16:48 +0800
committerjbeich <jbeich@FreeBSD.org>2018-01-26 23:16:48 +0800
commitce0bb9a5dac99199571e210f2482d1bd0a4e673b (patch)
tree483fca9dc35f672b596f0e9fe413036b11f188af /games
parentcc47ba5cddd398627f8c62f4d1f61a6dd13c7956 (diff)
downloadfreebsd-ports-gnome-ce0bb9a5dac99199571e210f2482d1bd0a4e673b.tar.gz
freebsd-ports-gnome-ce0bb9a5dac99199571e210f2482d1bd0a4e673b.tar.zst
freebsd-ports-gnome-ce0bb9a5dac99199571e210f2482d1bd0a4e673b.zip
games/xevil: unbreak build with Clang 6 (C++14 by default)
libc++ doesn't like "using namespace std" in C++11 role.cpp:656:62: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int') if (bind(udpSock,(CMN_SOCKADDR *)&client,sizeof(client)) >= 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ role.cpp:1829:70: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int') if (bind(tcpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ role.cpp:1836:70: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int') if (bind(udpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ serverping.cpp:173:60: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int') if (bind(udpSock,(CMN_SOCKADDR *)&client,sizeof(client)) < 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ Reported by: pkg-fallout
Diffstat (limited to 'games')
-rw-r--r--games/xevil/files/patch-cmn__role.cpp18
-rw-r--r--games/xevil/files/patch-x11__serverping.cpp6
2 files changed, 18 insertions, 6 deletions
diff --git a/games/xevil/files/patch-cmn__role.cpp b/games/xevil/files/patch-cmn__role.cpp
index 4d90e7b1329c..14aab160de04 100644
--- a/games/xevil/files/patch-cmn__role.cpp
+++ b/games/xevil/files/patch-cmn__role.cpp
@@ -82,7 +82,14 @@
// Probably would be better to use Role::message(), but we want it to stay
// up for a long time. Should add argument to Role::message().
-@@ -663,12 +659,10 @@
+@@ -657,18 +653,16 @@ void Client::connect_server() {
+ client.sin_family = AF_INET;
+ client.sin_addr.s_addr = htonl(INADDR_ANY);
+ client.sin_port = htons((u_short)(clientPortBase + n));
+- if (bind(udpSock,(CMN_SOCKADDR *)&client,sizeof(client)) >= 0) {
++ if (::bind(udpSock,(CMN_SOCKADDR *)&client,sizeof(client)) >= 0) {
+ // Success.
+ break;
}
}
if (n == CLIENT_PORT_TRIES) {
@@ -247,11 +254,13 @@
// Hack, using errLocator for more than reporting errors.
errLocator->set_remember_deleted(True);
errLocator->set_remember_sounds(True);
-@@ -1843,19 +1827,17 @@
+@@ -1842,20 +1826,18 @@ void Server::run() {
+ serverAddr.sin_port = htons(port);
// Give address to both the TCP and UDP sockets.
- if (bind(tcpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) {
+- if (bind(tcpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) {
- ostrstream str;
++ if (::bind(tcpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) {
+ stringstream str;
str << "Couldn't bind socket name to TCP socket on port "
- << port << "." << ends;
@@ -261,8 +270,9 @@
+ error(str.str().c_str());
return;
}
- if (bind(udpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) {
+- if (bind(udpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) {
- ostrstream str;
++ if (::bind(udpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) {
+ stringstream str;
str << "Couldn't bind socket name to UDP socket on port "
- << port << "." << ends;
diff --git a/games/xevil/files/patch-x11__serverping.cpp b/games/xevil/files/patch-x11__serverping.cpp
index debc89bafc73..b74b7e0f173b 100644
--- a/games/xevil/files/patch-x11__serverping.cpp
+++ b/games/xevil/files/patch-x11__serverping.cpp
@@ -41,14 +41,16 @@
// Create server address.
memset((void *)&serverAddr,'\0',sizeof(serverAddr));
-@@ -171,10 +171,9 @@
+@@ -170,11 +170,10 @@ ServerPing::ServerPing(int argc,char** argv) {
+ client.sin_family = AF_INET;
client.sin_addr.s_addr = htonl(INADDR_ANY);
client.sin_port = htons((u_short)clientPort);
- if (bind(udpSock,(CMN_SOCKADDR *)&client,sizeof(client)) < 0) {
+- if (bind(udpSock,(CMN_SOCKADDR *)&client,sizeof(client)) < 0) {
- ostrstream str;
- str << "Could not bind local UDP port " << clientPort << ends;
- error(str.str());
- delete str.str();
++ if (::bind(udpSock,(CMN_SOCKADDR *)&client,sizeof(client)) < 0) {
+ stringstream str;
+ str << "Could not bind local UDP port " << clientPort;
+ error(str.str().c_str());