diff options
author | jbeich <jbeich@FreeBSD.org> | 2018-01-26 23:16:48 +0800 |
---|---|---|
committer | Koop Mast <kwm@rainbow-runner.nl> | 2018-02-04 06:29:38 +0800 |
commit | a117461eff677c4bed54e831738298b0bae65a0f (patch) | |
tree | 7e0d4993e0b318562426b284fd0c58a56a5edaa5 /games | |
parent | 7fefbebf7c322bbe977955574d39bd7b43490a2a (diff) | |
download | freebsd-ports-gnome-a117461eff677c4bed54e831738298b0bae65a0f.tar.gz freebsd-ports-gnome-a117461eff677c4bed54e831738298b0bae65a0f.tar.zst freebsd-ports-gnome-a117461eff677c4bed54e831738298b0bae65a0f.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.cpp | 18 | ||||
-rw-r--r-- | games/xevil/files/patch-x11__serverping.cpp | 6 |
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()); |