This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git


The following commit(s) were added to refs/heads/master by this push:
     new 68430c66 Allow use of log4cxx::cast with OnlyOnceErrorHandler, 
Hierarchy and PropertyConfigurator (#329)
68430c66 is described below

commit 68430c6641069f4fb55134ef83f06765e000270f
Author: Stephen Webb <[email protected]>
AuthorDate: Thu Jan 11 09:58:28 2024 +1100

    Allow use of log4cxx::cast with OnlyOnceErrorHandler, Hierarchy and 
PropertyConfigurator (#329)
    
    Co-authored-by: Stephen Webb <[email protected]>
---
 src/main/include/log4cxx/helpers/onlyonceerrorhandler.h | 5 +++++
 src/main/include/log4cxx/hierarchy.h                    | 5 +++++
 src/main/include/log4cxx/propertyconfigurator.h         | 5 +++++
 3 files changed, 15 insertions(+)

diff --git a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h 
b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h
index d2a8cf91..20824b21 100644
--- a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h
+++ b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h
@@ -45,8 +45,13 @@ class LOG4CXX_EXPORT OnlyOnceErrorHandler :
        public:
                DECLARE_LOG4CXX_OBJECT(OnlyOnceErrorHandler)
                BEGIN_LOG4CXX_CAST_MAP()
+#if 15 < LOG4CXX_ABI_VERSION
+               LOG4CXX_CAST_ENTRY(OnlyOnceErrorHandler)
+               LOG4CXX_CAST_ENTRY_CHAIN(spi::ErrorHandler)
+#else
                LOG4CXX_CAST_ENTRY(spi::OptionHandler)
                LOG4CXX_CAST_ENTRY(spi::ErrorHandler)
+#endif
                END_LOG4CXX_CAST_MAP()
 
                OnlyOnceErrorHandler();
diff --git a/src/main/include/log4cxx/hierarchy.h 
b/src/main/include/log4cxx/hierarchy.h
index 38632304..8a913b2a 100644
--- a/src/main/include/log4cxx/hierarchy.h
+++ b/src/main/include/log4cxx/hierarchy.h
@@ -60,7 +60,12 @@ class LOG4CXX_EXPORT Hierarchy : public spi::LoggerRepository
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(Hierarchy)
                BEGIN_LOG4CXX_CAST_MAP()
+#if 15 < LOG4CXX_ABI_VERSION
+               LOG4CXX_CAST_ENTRY(Hierarchy)
+               LOG4CXX_CAST_ENTRY_CHAIN(spi::LoggerRepository)
+#else
                LOG4CXX_CAST_ENTRY(spi::LoggerRepository)
+#endif
                END_LOG4CXX_CAST_MAP()
 
        private:
diff --git a/src/main/include/log4cxx/propertyconfigurator.h 
b/src/main/include/log4cxx/propertyconfigurator.h
index 59057fe8..b8d47db7 100644
--- a/src/main/include/log4cxx/propertyconfigurator.h
+++ b/src/main/include/log4cxx/propertyconfigurator.h
@@ -101,7 +101,12 @@ class LOG4CXX_EXPORT PropertyConfigurator :
        public:
                DECLARE_LOG4CXX_OBJECT(PropertyConfigurator)
                BEGIN_LOG4CXX_CAST_MAP()
+#if 15 < LOG4CXX_ABI_VERSION
+               LOG4CXX_CAST_ENTRY(PropertyConfigurator)
+               LOG4CXX_CAST_ENTRY_CHAIN(spi::Configurator)
+#else
                LOG4CXX_CAST_ENTRY(spi::Configurator)
+#endif
                END_LOG4CXX_CAST_MAP()
 
                PropertyConfigurator();

Reply via email to