diff --git a/xhalcore/src/common/XHALInterface.cpp b/xhalcore/src/common/XHALInterface.cpp index 00664d3..bddfaf9 100644 --- a/xhalcore/src/common/XHALInterface.cpp +++ b/xhalcore/src/common/XHALInterface.cpp @@ -1,5 +1,7 @@ #include "xhal/XHALInterface.h" +#include + int xhal::XHALInterface::index = 0; xhal::XHALInterface::XHALInterface(const std::string& board_domain_name): @@ -7,8 +9,11 @@ xhal::XHALInterface::XHALInterface(const std::string& board_domain_name): isConnected(false) { log4cplus::SharedAppenderPtr myAppender(new log4cplus::ConsoleAppender()); - std::auto_ptr myLayout = std::auto_ptr(new log4cplus::TTCCLayout()); - myAppender->setLayout( myLayout ); +#if LOG4CPLUS_VERSION < LOG4CPLUS_MAKE_VERSION(2, 0, 0) + myAppender->setLayout(std::auto_ptr(new log4cplus::TTCCLayout())); +#else + myAppender->setLayout(std::unique_ptr(new log4cplus::TTCCLayout())); +#endif // Following strange construction is required because it looks like log4cplus was compiled withot c++11 support... auto t_logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("XHALInterface_"+m_board_domain_name + "_" + std::to_string(index))); ++index; diff --git a/xhalcore/src/common/utils/XHALXMLParser.cpp b/xhalcore/src/common/utils/XHALXMLParser.cpp index 91d730e..5ab5c35 100644 --- a/xhalcore/src/common/utils/XHALXMLParser.cpp +++ b/xhalcore/src/common/utils/XHALXMLParser.cpp @@ -1,13 +1,18 @@ #include "xhal/utils/XHALXMLParser.h" +#include + int xhal::utils::XHALXMLParser::index = 0; xhal::utils::XHALXMLParser::XHALXMLParser(const std::string& xmlFile) { m_xmlFile = xmlFile; log4cplus::SharedAppenderPtr myAppender(new log4cplus::ConsoleAppender()); - std::auto_ptr myLayout = std::auto_ptr(new log4cplus::TTCCLayout()); - myAppender->setLayout( myLayout ); +#if LOG4CPLUS_VERSION < LOG4CPLUS_MAKE_VERSION(2, 0, 0) + myAppender->setLayout(std::auto_ptr(new log4cplus::TTCCLayout())); +#else + myAppender->setLayout(std::unique_ptr(new log4cplus::TTCCLayout())); +#endif auto t_logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("XHALXMLParser_" + std::to_string(index))); ++index; m_logger = t_logger;