diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-02-28 22:05:06 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-02-28 22:05:06 +0000 |
commit | 5df0c8ba4bb09f65c6cfb7d67dead00d6b2a1bf9 (patch) | |
tree | ad139c5164214ddcb3471af11b3bbba70e031e24 /net-im/spectrum2/files | |
parent | 158e7d0067767d034ef3a86a07afbf5bb9bf579f (diff) |
gentoo auto-resync : 28:02:2023 - 22:05:06
Diffstat (limited to 'net-im/spectrum2/files')
-rw-r--r-- | net-im/spectrum2/files/spectrum2-2.1.3-log4cxx-1.0.0.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/net-im/spectrum2/files/spectrum2-2.1.3-log4cxx-1.0.0.patch b/net-im/spectrum2/files/spectrum2-2.1.3-log4cxx-1.0.0.patch new file mode 100644 index 000000000000..852f4ad78027 --- /dev/null +++ b/net-im/spectrum2/files/spectrum2-2.1.3-log4cxx-1.0.0.patch @@ -0,0 +1,63 @@ +Description: (newer) Debian log4cxx needs C++17 and used smart pointers. + This patch just enables C++17 for the build and using smart pointers + where needed. +Author: Tobias Frost <tobi@debian.org> +Forwarded: not yet. log4cxx 0.14 will come with some preprocessor macros that will enable properly gating the new code. +Last-Update: 2022-11-21 <YYYY-MM-DD, last update of the meta-information, optional> +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,7 +2,7 @@ + + project(libtransport) + +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 17) + if(WIN32) + set(CMAKE_CXX_STANDARD 17) + endif(WIN32) +--- a/plugin/cpp/Logging.cpp ++++ b/plugin/cpp/Logging.cpp +@@ -26,6 +26,7 @@ + #include <iterator> + #include <algorithm> + ++#include <memory> + + #include <boost/filesystem.hpp> + #include <boost/algorithm/string.hpp> +@@ -100,15 +101,17 @@ + #ifdef _MSC_VER + root->addAppender(new ConsoleAppender(new PatternLayout(L"%d %-5p %c: %m%n"))); + #else +- root->addAppender(new ConsoleAppender(new PatternLayout("%d %-5p %c: %m%n"))); ++ auto patternlayout = std::make_shared<PatternLayout>("%d %-5p %c: %m%n"); ++ auto consoleappender = std::make_shared<ConsoleAppender>(patternlayout); ++ root->addAppender(consoleappender); + #endif + } + else { + log4cxx::helpers::Properties p; + +- log4cxx::helpers::FileInputStream *istream = NULL; ++ log4cxx::helpers::InputStreamPtr istream; + try { +- istream = new log4cxx::helpers::FileInputStream(CONFIG_STRING(config, key)); ++ istream.reset(new log4cxx::helpers::FileInputStream(CONFIG_STRING(config, key))); + } + catch(log4cxx::helpers::IOException &ex) { + std::cerr << "Can't create FileInputStream logger instance: " << ex.what() << "\n"; +--- a/tests/libtransport/main.cpp ++++ b/tests/libtransport/main.cpp +@@ -23,7 +23,9 @@ + #ifdef WITH_LOG4CXX + LoggerPtr root = Logger::getRootLogger(); + #ifndef _MSC_VER +- root->addAppender(new FileAppender(new PatternLayout("%d %-5p %c: %m%n"), "libtransport_test.log", false)); ++ auto patternlayout = std::make_shared<PatternLayout>("%d %-5p %c: %m%n"); ++ auto fileappender = std::make_shared<FileAppender>(patternlayout, "libtransport_test.log", false); ++ root->addAppender(fileappender); + #else + root->addAppender(new FileAppender(new PatternLayout(L"%d %-5p %c: %m%n"), L"libtransport_test.log", false)); + #endif |