From 9e3c4802ec160b2e12f7ac1fbbc09e8d1cfdf7b3 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Fri, 26 Jan 2018 15:17:02 +0000 Subject: [PATCH] games/crack-attack: unbreak build with Clang 6 (C++14 by default) libc++ doesn't like "using namespace std" in C++11 Communicator.cxx:139:73: error: invalid operands to binary expression ('__bind' and 'int') if (bind(connection_socket, (sockaddr *) &address, sizeof(address)) < 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ Reported by: pkg-fallout Approved by: portmgr blanket --- .../files/patch-src_Communicator.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 games/crack-attack/files/patch-src_Communicator.cxx diff --git a/games/crack-attack/files/patch-src_Communicator.cxx b/games/crack-attack/files/patch-src_Communicator.cxx new file mode 100644 index 000000000000..036df0235fcd --- /dev/null +++ b/games/crack-attack/files/patch-src_Communicator.cxx @@ -0,0 +1,17 @@ +libc++ doesn't like "using namespace std" in C++11 + +Communicator.cxx:139:73: error: invalid operands to binary expression ('__bind' and 'int') + if (bind(connection_socket, (sockaddr *) &address, sizeof(address)) < 0) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ + +--- src/Communicator.cxx.orig 2005-04-16 08:13:38 UTC ++++ src/Communicator.cxx +@@ -136,7 +136,7 @@ void Communicator::initialize ( int mode, int port, ch + address.sin_addr.s_addr = htonl(INADDR_ANY); + address.sin_port = htons(port); + +- if (bind(connection_socket, (sockaddr *) &address, sizeof(address)) < 0) { ++ if (::bind(connection_socket, (sockaddr *) &address, sizeof(address)) < 0) { + cerr << "Port " << port << " is busy." << endl; + exit(1); + }