package/log4cxx: fix build without wchar
PATCH v2 1/1 package/log4cxx: fix build without wchar
Fix build with log4cxx in version 0.11.0
Fixes:
- http://autobuild.buildroot.org/results/bab5329fdeb894471bfd5192ce04d3fbd2f9be5c
Signed-off-by Fabrice Fontaine <[email protected]>
---
Changes v1 -> v2:
- Retrieve upstream patch
.../0001-fix-build-without-wchar.patch | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 package/log4cxx/0001-fix-build-without-wchar.patch
package/log4cxx/0001-fix-build-without-wchar.patch new file +55 -0
@@ -0,0 +1,55 @@ +From 1fa70eaf24d75e84625f22779ec347fd29bf1ae6 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +Date: Thu, 24 Sep 2020 08:47:37 +0200 +Subject: [PATCH] fix build without wchar + +Disable wencode without wchar or the build will fail on: + +odbcappender.cpp: In static member function 'static void log4cxx::db::ODBCAppender::encode(wchar_t**, const LogString&, log4cxx::helpers::Pool&)': +odbcappender.cpp:362:22: error: 'wencode' is not a member of 'log4cxx::helpers::Transcoder' + *dest = Transcoder::wencode(src, p); + ^~~~~~~ + +Fixes: + - http://autobuild.buildroot.org/results/bab5329fdeb894471bfd5192ce04d3fbd2f9be5c + +Signed-off-by: Fabrice Fontaine <[email protected]> +[Retrieved from: +https://github.com/apache/logging-log4cxx/commit/f171f818c798d48631d5b45851e4593953f31d9c] +--- + src/main/cpp/odbcappender.cpp | 2 ++ + src/main/include/log4cxx/db/odbcappender.h | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/src/main/cpp/odbcappender.cpp b/src/main/cpp/odbcappender.cpp +index 6bfa519e..218df132 100644 +--- a/src/main/cpp/odbcappender.cpp ++++ b/src/main/cpp/odbcappender.cpp +@@ -357,10 +357,12 @@ void ODBCAppender::setSql(const LogString& s) + } + } + ++#if LOG4CXX_WCHAR_T_API || LOG4CXX_LOGCHAR_IS_WCHAR_T || defined(WIN32) || defined(_WIN32) + void ODBCAppender::encode(wchar_t** dest, const LogString& src, Pool& p) + { + *dest = Transcoder::wencode(src, p); + } ++#endif + + void ODBCAppender::encode(unsigned short** dest, + const LogString& src, Pool& p) +diff --git a/src/main/include/log4cxx/db/odbcappender.h b/src/main/include/log4cxx/db/odbcappender.h +index a26bc35b..fdc144ff 100644 +--- a/src/main/include/log4cxx/db/odbcappender.h ++++ b/src/main/include/log4cxx/db/odbcappender.h +@@ -300,8 +300,10 @@ class LOG4CXX_EXPORT ODBCAppender : public AppenderSkeleton + private: + ODBCAppender(const ODBCAppender&); + ODBCAppender& operator=(const ODBCAppender&); ++#if LOG4CXX_WCHAR_T_API || LOG4CXX_LOGCHAR_IS_WCHAR_T || defined(WIN32) || defined(_WIN32) + static void encode(wchar_t** dest, const LogString& src, + log4cxx::helpers::Pool& p); ++#endif + static void encode(unsigned short** dest, const LogString& src, + log4cxx::helpers::Pool& p); + }; // class ODBCAppender
Signature · 1 line
2.28.0
Thomas Petazzoni
AppliedPATCH v2 1/1 package/log4cxx: fix build without wchar
Quoted 9 lines · On Mon, 28 Sep 2020 21:17:30 +0200 Fabrice Fontaine…
Fix build with log4cxx in version 0.11.0
Fixes:
- http://autobuild.buildroot.org/results/bab5329fdeb894471bfd5192ce04d3fbd2f9be5cSigned-off-by Fabrice Fontaine <[email protected]>---
Changes v1 -> v2:
- Retrieve upstream patch
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com