From c8cdbcfe223d4e60d41ae8f951857230435db32b Mon Sep 17 00:00:00 2001 From: loonycyborg Date: Fri, 3 Jun 2016 00:30:32 +0400 Subject: [PATCH 1/6] Made wesnothd work if built on windows Disabled handling of SIGHUP on windows because trying to add it to signal set causes an exception. Do not disable asio's thread support on windows since it causes deadline_timer to throw. --- src/server/player_connection.hpp | 2 ++ src/server/server.cpp | 6 ++++++ src/server/server.hpp | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/server/player_connection.hpp b/src/server/player_connection.hpp index 4e0e95ea11f0..f45709e79248 100644 --- a/src/server/player_connection.hpp +++ b/src/server/player_connection.hpp @@ -19,7 +19,9 @@ #include "simple_wml.hpp" #include "player.hpp" +#ifndef _WIN32 #define BOOST_ASIO_DISABLE_THREADS +#endif #include #include diff --git a/src/server/server.cpp b/src/server/server.cpp index c71eabaf68e7..11378e37c374 100644 --- a/src/server/server.cpp +++ b/src/server/server.cpp @@ -406,7 +406,9 @@ server::server(int port, bool keep_alive, const std::string& config_file, size_t last_stats_(last_ping_), last_uh_clean_(last_ping_), cmd_handlers_(), +#ifndef _WIN32 sighup_(io_service_, SIGHUP), +#endif sigs_(io_service_, SIGINT, SIGTERM), timer_(io_service_) { @@ -424,10 +426,13 @@ server::server(int port, bool keep_alive, const std::string& config_file, size_t load_config(); ban_manager_.read(); +#ifndef _WIN32 sighup_.async_wait(boost::bind(&server::handle_sighup, this, _1, _2)); +#endif sigs_.async_wait(boost::bind(&server::handle_termination, this, _1, _2)); } +#ifndef _WIN32 void server::handle_sighup(const boost::system::error_code& error, int) { assert(!error); @@ -438,6 +443,7 @@ void server::handle_sighup(const boost::system::error_code& error, int) { sighup_.async_wait(boost::bind(&server::handle_sighup, this, _1, _2)); } +#endif void server::handle_termination(const boost::system::error_code& error, int signal_number) { diff --git a/src/server/server.hpp b/src/server/server.hpp index da628ca45948..29d922d0b0f5 100644 --- a/src/server/server.hpp +++ b/src/server/server.hpp @@ -232,8 +232,10 @@ class server void searchlog_handler(const std::string &, const std::string &, std::string &, std::ostringstream *); void dul_handler(const std::string &, const std::string &, std::string &, std::ostringstream *); +#ifndef _WIN32 boost::asio::signal_set sighup_; void handle_sighup(const boost::system::error_code& error, int signal_number); +#endif boost::asio::signal_set sigs_; void handle_termination(const boost::system::error_code& error, int signal_number); From a6228e84ad589b4831366e4f3bc6333f2bc2430e Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Fri, 3 Jun 2016 03:51:07 -0400 Subject: [PATCH 2/6] Mention C++11 compiler requirement --- INSTALL | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/INSTALL b/INSTALL index 13e2b82ff9a2..c4925c5e9fbd 100644 --- a/INSTALL +++ b/INSTALL @@ -11,6 +11,9 @@ Contents 1. Prerequisites ================ +Wesnoth requires a compiler with sufficient C++11 support such as GCC 4.7 and +later, or Clang 3.3 and later. + You'll need to have these libraries and their development headers installed in order to build Wesnoth: @@ -92,11 +95,6 @@ also possible to run it directly from the source directory after building. This may be useful in situations where you don't have root access or need to rebuild Wesnoth frequently (i.e. for development and testing). -NOTE: It has been reported that using GCC 3.3.6 and earlier versions with -optimizations enabled will result in a build that is incapable of using -multiplayer. See for further details. We -recommend using GCC 4.x and later to build Wesnoth. - 3. SCons Build ============== From 3cc654d025a67b482a0a1e4d88bdf9c0d4b9cb37 Mon Sep 17 00:00:00 2001 From: loonycyborg Date: Fri, 3 Jun 2016 13:47:19 +0300 Subject: [PATCH 3/6] Disable -Wold-style-cast for lua test with gcc #pragma --- src/tests/test_lua.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/test_lua.cpp b/src/tests/test_lua.cpp index abe554d67679..f2f95bbabf6d 100644 --- a/src/tests/test_lua.cpp +++ b/src/tests/test_lua.cpp @@ -23,6 +23,8 @@ # include #endif +#pragma GCC diagnostic ignored "-Wold-style-cast" + BOOST_AUTO_TEST_SUITE( lua ) static int lua_round(lua_State * L, double d) From d859dcc3f5190e1f00122983aa0140ceae94f1e9 Mon Sep 17 00:00:00 2001 From: loonycyborg Date: Fri, 3 Jun 2016 14:06:36 +0300 Subject: [PATCH 4/6] Try to fix warning on travis --- src/desktop/open.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/desktop/open.cpp b/src/desktop/open.cpp index 985fe2ec5d4a..e751b2d5c427 100644 --- a/src/desktop/open.cpp +++ b/src/desktop/open.cpp @@ -79,9 +79,13 @@ bool open_object(const std::string& path_or_url) } if(child_status) { +//Those status check macros seem to trigger old style casts on some compiler versions +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" if(WIFEXITED(child_status)) { ERR_DU << "open_object(): " << launcher << " returned " << WEXITSTATUS(child_status) << '\n'; +#pragma GCC diagnostic pop } else { ERR_DU << "open_object(): " << launcher << " failed" << std::endl; } From d6b48759dc54e577507a4032a845463e7aaed4d0 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Sat, 4 Jun 2016 00:14:10 +1100 Subject: [PATCH 5/6] Hornshark: remove unit ids from Clockwork Boy units (bug #24722) This prevents ID conflicts resulting in certain units disappearing. They weren't used anywhere in the scenario anyway. --- data/multiplayer/scenarios/2p_Hornshark_Island.cfg | 4 ---- 1 file changed, 4 deletions(-) diff --git a/data/multiplayer/scenarios/2p_Hornshark_Island.cfg b/data/multiplayer/scenarios/2p_Hornshark_Island.cfg index 94008cf23410..30587902a200 100644 --- a/data/multiplayer/scenarios/2p_Hornshark_Island.cfg +++ b/data/multiplayer/scenarios/2p_Hornshark_Island.cfg @@ -242,7 +242,6 @@ [unit] side=1 type=Woodsman - id=Clockwork Boy name= _ "Clockwork Boy" x,y=1,2 [modifications] @@ -254,7 +253,6 @@ [unit] side=1 type=Woodsman - id=Clockwork Boy name= _ "Clockwork Boy" x,y=2,1 [modifications] @@ -702,7 +700,6 @@ [unit] side=2 type=Woodsman - id=Clockwork Boy name= _ "Clockwork Boy" x,y=30,27 [modifications] @@ -714,7 +711,6 @@ [unit] side=2 type=Woodsman - id=Clockwork Boy name= _ "Clockwork Boy" x,y=29,27 [modifications] From 1ec81a3506e3e346295b025ca4913fe1ef4c3b0c Mon Sep 17 00:00:00 2001 From: loonycyborg Date: Fri, 3 Jun 2016 16:50:31 +0300 Subject: [PATCH 6/6] Disable -Wold-style-cast for dbus-using code to placate travis --- src/desktop/dbus_notification.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/desktop/dbus_notification.cpp b/src/desktop/dbus_notification.cpp index 8f7bc1564be9..c5fbaad52249 100644 --- a/src/desktop/dbus_notification.cpp +++ b/src/desktop/dbus_notification.cpp @@ -32,6 +32,8 @@ #include #include +#pragma GCC diagnostic ignored "-Wold-style-cast" + using boost::uint32_t; static lg::log_domain log_desktop("desktop");