This is an automated email from the ASF dual-hosted git repository. swebb2066 pushed a commit to branch remove_thread_local in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit 03a78faa561b49936ebeb735bb5f26f6576a7863 Author: Stephen Webb <[email protected]> AuthorDate: Tue May 26 11:20:06 2026 +1000 Remove the unused class helpers::ThreadLocal in the next ABI version --- src/main/cpp/CMakeLists.txt | 8 ++++++-- src/main/cpp/threadlocal.cpp | 3 +++ src/main/include/log4cxx/helpers/threadlocal.h | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/cpp/CMakeLists.txt b/src/main/cpp/CMakeLists.txt index 92f04995..5a2d3d22 100644 --- a/src/main/cpp/CMakeLists.txt +++ b/src/main/cpp/CMakeLists.txt @@ -212,7 +212,6 @@ target_sources(log4cxx system.cpp systemerrwriter.cpp systemoutwriter.cpp - threadlocal.cpp threadpatternconverter.cpp threadusernamepatternconverter.cpp threadspecificdata.cpp @@ -229,7 +228,12 @@ target_sources(log4cxx zipcompressaction.cpp ${extra_classes} ) - +if(${log4cxx_ABI_VER} LESS 16) + target_sources(log4cxx + PRIVATE + threadlocal.cpp + ) +endif() if(LOG4CXX_EVENTS_AT_EXIT) target_sources(log4cxx PRIVATE atexitregistry.cpp diff --git a/src/main/cpp/threadlocal.cpp b/src/main/cpp/threadlocal.cpp index 5bc91711..9abb7612 100644 --- a/src/main/cpp/threadlocal.cpp +++ b/src/main/cpp/threadlocal.cpp @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#if LOG4CXX_ABI_VERSION <= 15 #include "log4cxx/helpers/threadlocal.h" #include "apr_thread_proc.h" @@ -72,3 +73,5 @@ void* ThreadLocal::get() #endif return retval; } + +#endif // LOG4CXX_ABI_VERSION <= 15 diff --git a/src/main/include/log4cxx/helpers/threadlocal.h b/src/main/include/log4cxx/helpers/threadlocal.h index abc54d7f..5c27a92b 100644 --- a/src/main/include/log4cxx/helpers/threadlocal.h +++ b/src/main/include/log4cxx/helpers/threadlocal.h @@ -17,6 +17,7 @@ #ifndef _LOG4CXX_HELPERS_THREAD_LOCAL_H #define _LOG4CXX_HELPERS_THREAD_LOCAL_H +#if LOG4CXX_ABI_VERSION <= 15 #include <log4cxx/log4cxx.h> #include <log4cxx/helpers/pool.h> @@ -40,6 +41,8 @@ namespace helpers { /** + * @deprecated This class is deprecated and will be removed in a future version. + * * This class provides thread-local variables. This class is similar in function * to java.lang.ThreadLocal. */ @@ -83,4 +86,6 @@ class LOG4CXX_EXPORT ThreadLocal } // namespace helpers } // namespace log4cxx +#endif // LOG4CXX_ABI_VERSION <= 15 + #endif //_LOG4CXX_HELPERS_THREAD_LOCAL_H
