From 064159d2b25b73c9480e7e710ee7af2aabb4341e Mon Sep 17 00:00:00 2001 From: Felix Igelbrink Date: Wed, 1 Nov 2017 13:09:55 +0100 Subject: [PATCH 1/3] fixed compilation errors for c++14 --- CMakeLists.txt | 3 ++- src/PLASMA/CMakeLists.txt | 2 -- src/PLASMA/NDDL/component/Interpreter.cc | 6 ++++++ src/PLASMA/PlanDatabase/base/PlanDatabase.cc | 4 ++-- src/PLASMA/Utils/base/DebugMsg.cc | 4 ++-- src/PLASMA/Utils/base/Entity.cc | 4 ++-- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ab32a48..c63ff3305 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ endif((CMAKE_MAJOR_VERSION GREATER 3) OR (CMAKE_MAJOR_VERSION EQUAL 3)) set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake") project(Europa2 C CXX Java) +set(CMAKE_CXX_STANDARD 14) add_definitions(-DTIXML_USE_STL=1) enable_testing() set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) @@ -39,4 +40,4 @@ add_subdirectory(src) install(EXPORT Europa2 DESTINATION ${EUROPA_ROOT}/dist/europa) install(DIRECTORY ${EUROPA_ROOT}/bin DESTINATION ${EUROPA_ROOT}/dist/europa) install(DIRECTORY ${EUROPA_ROOT}/config DESTINATION ${EUROPA_ROOT}/dist/europa) -install(DIRECTORY ${EUROPA_ROOT}/bin/.makeproject DESTINATION ${EUROPA_ROOT}/dist/bin) \ No newline at end of file +install(DIRECTORY ${EUROPA_ROOT}/bin/.makeproject DESTINATION ${EUROPA_ROOT}/dist/bin) diff --git a/src/PLASMA/CMakeLists.txt b/src/PLASMA/CMakeLists.txt index 833e13b39..2aa202f1c 100644 --- a/src/PLASMA/CMakeLists.txt +++ b/src/PLASMA/CMakeLists.txt @@ -42,8 +42,6 @@ else() else() message(FATAL_ERROR "Failed to find boost libraries") endif() -else() - message(FATAL_ERROR "Failed to find boost libraries") endif() add_subdirectory(TinyXml) diff --git a/src/PLASMA/NDDL/component/Interpreter.cc b/src/PLASMA/NDDL/component/Interpreter.cc index 55a4da9db..57d4c5ddd 100644 --- a/src/PLASMA/NDDL/component/Interpreter.cc +++ b/src/PLASMA/NDDL/component/Interpreter.cc @@ -32,6 +32,12 @@ #include #include + + +// definition of before causes errors in newer versions of boost +#ifdef before +#undef before +#endif #include #include diff --git a/src/PLASMA/PlanDatabase/base/PlanDatabase.cc b/src/PLASMA/PlanDatabase/base/PlanDatabase.cc index d1b5bc4e1..f8cc3edb4 100644 --- a/src/PLASMA/PlanDatabase/base/PlanDatabase.cc +++ b/src/PLASMA/PlanDatabase/base/PlanDatabase.cc @@ -548,8 +548,8 @@ unsigned long PlanDatabase::countCompatibleTokens(const TokenId inactiveToken, object->getOrderingChoices(tokenToOrder, choices, limit - count); for (std::vector >::iterator it_b = choices.begin(); it_b != choices.end(); ++it_b) { - const std::pair& tokenPair = *it_b; - results.push_back(std::make_pair >(object, tokenPair)); + std::pair& tokenPair = *it_b; + results.push_back(std::make_pair >(std::move(object), std::move(tokenPair))); count++; } } diff --git a/src/PLASMA/Utils/base/DebugMsg.cc b/src/PLASMA/Utils/base/DebugMsg.cc index 9a8a1fb97..c004d69e4 100755 --- a/src/PLASMA/Utils/base/DebugMsg.cc +++ b/src/PLASMA/Utils/base/DebugMsg.cc @@ -316,8 +316,8 @@ internals_accessor; internals_accessor internals() { EUROPA::MutexGrabber grabber(debugMutex); return std::make_pair >(grabber, - boost::ref(debugInternals)); + boost::reference_wrapper >(std::move(grabber), + boost::reference_wrapper(debugInternals)); } } diff --git a/src/PLASMA/Utils/base/Entity.cc b/src/PLASMA/Utils/base/Entity.cc index aab8e925d..5093f042c 100644 --- a/src/PLASMA/Utils/base/Entity.cc +++ b/src/PLASMA/Utils/base/Entity.cc @@ -72,8 +72,8 @@ internals_accessor; internals_accessor internals() { MutexGrabber grabber(entityMutex); return std::make_pair >(grabber, - boost::ref(entityInternals)); + boost::reference_wrapper >(std::move(grabber), + boost::reference_wrapper(entityInternals)); } } From 7b41a913f01464343f241928ea6bd5377570b04c Mon Sep 17 00:00:00 2001 From: Felix Igelbrink Date: Wed, 1 Nov 2017 13:10:24 +0100 Subject: [PATCH 2/3] fixed missing cstring library for strdup --- src/PLASMA/NDDL/base/antlr/NDDL3.g | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PLASMA/NDDL/base/antlr/NDDL3.g b/src/PLASMA/NDDL/base/antlr/NDDL3.g index 594409985..26a8bb6f8 100644 --- a/src/PLASMA/NDDL/base/antlr/NDDL3.g +++ b/src/PLASMA/NDDL/base/antlr/NDDL3.g @@ -64,6 +64,7 @@ static void newNDDL3ParserFree(pNDDL3Parser ctx) { { #include "NddlInterpreter.hh" #include "PathDefs.hh" +#include using namespace EUROPA; From 343cdfadd332cd5fad8bd1bd606c09dd0716db96 Mon Sep 17 00:00:00 2001 From: Felix Igelbrink Date: Wed, 1 Nov 2017 13:11:00 +0100 Subject: [PATCH 3/3] renamed python to python2 to be consistent with newer python versions on arch linux --- bin/makeproject | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/makeproject b/bin/makeproject index ca9328780..8e9a6d497 100755 --- a/bin/makeproject +++ b/bin/makeproject @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 import re import sys import os