From 23a5ce69bf07a13f8cf4f15aa8f8fa1f2291a37d Mon Sep 17 00:00:00 2001 From: Japa Date: Sun, 29 Nov 2015 00:03:26 +0530 Subject: [PATCH 1/2] Send unit names over remotefortressreader --- plugins/proto/RemoteFortressReader.proto | 3 +++ plugins/remotefortressreader.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/plugins/proto/RemoteFortressReader.proto b/plugins/proto/RemoteFortressReader.proto index 53dc0144a..aaf78ad91 100644 --- a/plugins/proto/RemoteFortressReader.proto +++ b/plugins/proto/RemoteFortressReader.proto @@ -229,6 +229,9 @@ message UnitDefinition optional uint32 flags3 = 10; optional bool is_soldier = 11; optional BodySizeInfo size_info = 12; + optional string name = 13; + optional int32 blood_max = 14; + optional int32 blood_count = 15; } message UnitList diff --git a/plugins/remotefortressreader.cpp b/plugins/remotefortressreader.cpp index 6a98bc05b..2c97b35b7 100644 --- a/plugins/remotefortressreader.cpp +++ b/plugins/remotefortressreader.cpp @@ -1343,6 +1343,10 @@ static command_result GetUnitList(color_ostream &stream, const EmptyMessage *in, size_info->set_area_base(unit->body.size_info.area_base); size_info->set_length_cur(unit->body.size_info.length_cur); size_info->set_length_base(unit->body.size_info.length_base); + if (unit->name.has_name) + { + send_unit->set_name(DF2UTF(Translation::TranslateName(Units::getVisibleName(unit)))); + } } return CR_OK; } From d84f5f1e52057dd44d5bc10385e04fc1dc7d0fcc Mon Sep 17 00:00:00 2001 From: TheBloke Date: Sun, 29 Nov 2015 14:26:11 +0000 Subject: [PATCH 2/2] Re-enable GCC 5 compilation for OSX and Linux, passing -D_GLIBCXX_USE_CXX11_ABI=0 to disable new C++11 name mangling and remain compatible with DF. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 82ceafd38..fe289a9f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,8 +24,13 @@ project(dfhack) macro(CHECK_GCC COMPILER_PATH) execute_process(COMMAND ${COMPILER_PATH} -dumpversion OUTPUT_VARIABLE GCC_VERSION_OUT) string(STRIP "${GCC_VERSION_OUT}" GCC_VERSION_OUT) - if (${GCC_VERSION_OUT} VERSION_LESS "4.5" OR ${GCC_VERSION_OUT} VERSION_GREATER "4.9.9") - message(SEND_ERROR "${COMPILER_PATH} version ${GCC_VERSION_OUT} cannot be used - use GCC 4.5 through 4.9") + if (${GCC_VERSION_OUT} VERSION_LESS "4.5") + message(SEND_ERROR "${COMPILER_PATH} version ${GCC_VERSION_OUT} cannot be used - use GCC 4.5 or later") + elseif (${GCC_VERSION_OUT} VERSION_GREATER "4.9.9") + # GCC 5 changes ABI name mangling to enable C++11 changes. + # This must be disabled to enable linking against DF. + # http://developerblog.redhat.com/2015/02/05/gcc5-and-the-c11-abi/ + add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) endif() endmacro()