Date: Fri, 26 Jan 2018 15:17:03 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r460008 - head/games/crack-attack/files Message-ID: <201801261517.w0QFH3r8024199@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Fri Jan 26 15:17:02 2018 New Revision: 460008 URL: https://svnweb.freebsd.org/changeset/ports/460008 Log: 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<int &, sockaddr *, unsigned long>' and 'int') if (bind(connection_socket, (sockaddr *) &address, sizeof(address)) < 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ Reported by: pkg-fallout Approved by: portmgr blanket Added: head/games/crack-attack/files/patch-src_Communicator.cxx (contents, props changed) Added: head/games/crack-attack/files/patch-src_Communicator.cxx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/crack-attack/files/patch-src_Communicator.cxx Fri Jan 26 15:17:02 2018 (r460008) @@ -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<int &, sockaddr *, unsigned long>' 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); + }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801261517.w0QFH3r8024199>