diff --git a/.github/workflows/log4cxx-macos.yml b/.github/workflows/log4cxx-macos.yml index 5f10ccff5..90371ac56 100644 --- a/.github/workflows/log4cxx-macos.yml +++ b/.github/workflows/log4cxx-macos.yml @@ -45,7 +45,7 @@ jobs: cd main mkdir build cd build - cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DLOG4CXX_ENABLE_ODBC=on -DLOG4CXX_CFSTRING=on .. + cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DLOG4CXX_ENABLE_ODBC=ON -DLOG4CXX_CFSTRING=ON .. cmake --build . - name: run unit tests diff --git a/.github/workflows/log4cxx-ubuntu.yml b/.github/workflows/log4cxx-ubuntu.yml index d032ebb62..ee8ac96c4 100644 --- a/.github/workflows/log4cxx-ubuntu.yml +++ b/.github/workflows/log4cxx-ubuntu.yml @@ -58,7 +58,7 @@ jobs: cd main mkdir build cd build - cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DLOG4CXX_ENABLE_ODBC=on .. + cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DLOG4CXX_ENABLE_ODBC=ON .. cmake --build . - name: run unit tests diff --git a/src/main/cpp/messagebuffer.cpp b/src/main/cpp/messagebuffer.cpp index cc9e34acb..aec85f014 100644 --- a/src/main/cpp/messagebuffer.cpp +++ b/src/main/cpp/messagebuffer.cpp @@ -779,13 +779,6 @@ UniCharMessageBuffer& MessageBuffer::operator<<(const CFStringRef& msg) #include #include -#if LOG4CXX_WCHAR_T_API -CharMessageBuffer& MessageBuffer::operator<<(const CFStringRef& msg) -{ - LOG4CXX_DECODE_CFSTRING(tmp, msg); - return m_priv->cbuf << tmp; -} -#else // MessageBuffer is CharMessageBuffer CharMessageBuffer& CharMessageBuffer::operator<<(const CFStringRef& msg) { LOG4CXX_DECODE_CFSTRING(tmp, msg); @@ -799,6 +792,14 @@ CharMessageBuffer& CharMessageBuffer::operator<<(const CFStringRef& msg) } return *this; } -#endif // MessageBuffer is CharMessageBuffer + +#if LOG4CXX_WCHAR_T_API +CharMessageBuffer& MessageBuffer::operator<<(const CFStringRef& msg) +{ + LOG4CXX_DECODE_CFSTRING(tmp, msg); + return m_priv->cbuf << tmp; +} +#endif // LOG4CXX_WCHAR_T_API + #endif // LOG4CXX_CFSTRING_API diff --git a/src/main/include/log4cxx/helpers/messagebuffer.h b/src/main/include/log4cxx/helpers/messagebuffer.h index 583de1364..cc568f25a 100644 --- a/src/main/include/log4cxx/helpers/messagebuffer.h +++ b/src/main/include/log4cxx/helpers/messagebuffer.h @@ -74,7 +74,7 @@ class LOG4CXX_EXPORT CharMessageBuffer * @return this buffer. */ CharMessageBuffer& operator<<(const char msg); -#if LOG4CXX_CFSTRING_API && !LOG4CXX_WCHAR_T_API +#if LOG4CXX_CFSTRING_API /** * Appends a string into the buffer and * fixes the buffer to use char characters. @@ -82,7 +82,6 @@ class LOG4CXX_EXPORT CharMessageBuffer * @return encapsulated CharMessageBuffer. */ CharMessageBuffer& operator<<(const CFStringRef& msg); - #endif /** @@ -743,7 +742,6 @@ class LOG4CXX_EXPORT MessageBuffer * @return encapsulated CharMessageBuffer. */ CharMessageBuffer& operator<<(const CFStringRef& msg); - #endif /**