This is an automated email from the ASF dual-hosted git repository. swebb2066 pushed a commit to branch reduce_virtual_inheritance in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit 945b0e82627ac5b5f382e2fbf18bc0981b98777d Author: Stephen Webb <[email protected]> AuthorDate: Sun Apr 26 11:38:34 2026 +1000 Generate fewer virtual base table pointers in the next ABI version --- src/main/cpp/smtpappender.cpp | 10 +++++++--- src/main/include/log4cxx/appender.h | 8 ++++++-- src/main/include/log4cxx/appenderskeleton.h | 10 +++++++--- src/main/include/log4cxx/helpers/onlyonceerrorhandler.h | 10 +++++++--- src/main/include/log4cxx/layout.h | 10 +++++++--- src/main/include/log4cxx/rolling/rollingpolicybase.h | 10 +++++++--- src/main/include/log4cxx/rolling/timebasedrollingpolicy.h | 10 ++++++++-- src/main/include/log4cxx/rolling/triggeringpolicy.h | 10 +++++++--- src/main/include/log4cxx/spi/defaultrepositoryselector.h | 10 +++++++--- src/main/include/log4cxx/spi/errorhandler.h | 7 ++++++- src/main/include/log4cxx/spi/filter.h | 7 ++++++- src/main/include/log4cxx/varia/fallbackerrorhandler.h | 8 ++++++-- src/test/cpp/customlogger/xlogger.h | 5 ++--- src/test/cpp/net/smtpappendertestcase.cpp | 2 +- 14 files changed, 84 insertions(+), 33 deletions(-) diff --git a/src/main/cpp/smtpappender.cpp b/src/main/cpp/smtpappender.cpp index 552e51a9..00be169c 100644 --- a/src/main/cpp/smtpappender.cpp +++ b/src/main/cpp/smtpappender.cpp @@ -342,9 +342,13 @@ class SMTPMessage }; #endif -class LOG4CXX_EXPORT DefaultEvaluator : - public virtual spi::TriggeringEventEvaluator, - public virtual helpers::Object +class LOG4CXX_EXPORT DefaultEvaluator +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual spi::TriggeringEventEvaluator + , public virtual helpers::Object +#else + : public spi::TriggeringEventEvaluator +#endif { public: DECLARE_LOG4CXX_OBJECT(DefaultEvaluator) diff --git a/src/main/include/log4cxx/appender.h b/src/main/include/log4cxx/appender.h index 8e74552e..1289cea0 100644 --- a/src/main/include/log4cxx/appender.h +++ b/src/main/include/log4cxx/appender.h @@ -46,8 +46,12 @@ typedef std::shared_ptr<Layout> LayoutPtr; Implement this interface for your own strategies for outputting log statements. */ -class LOG4CXX_EXPORT Appender : - public virtual spi::OptionHandler +class LOG4CXX_EXPORT Appender +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual spi::OptionHandler +#else + : public spi::OptionHandler +#endif { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(Appender) diff --git a/src/main/include/log4cxx/appenderskeleton.h b/src/main/include/log4cxx/appenderskeleton.h index 585532c3..a9557a67 100644 --- a/src/main/include/log4cxx/appenderskeleton.h +++ b/src/main/include/log4cxx/appenderskeleton.h @@ -35,9 +35,13 @@ namespace LOG4CXX_NS * This class provides the code for common functionality, such as * support for threshold filtering and support for general filters. * */ -class LOG4CXX_EXPORT AppenderSkeleton : - public virtual Appender, - public virtual helpers::Object +class LOG4CXX_EXPORT AppenderSkeleton +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual Appender + , public virtual helpers::Object +#else + : public Appender +#endif { protected: LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(AppenderSkeletonPrivate, m_priv) diff --git a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h index 7725f21e..2a5c7aef 100644 --- a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h +++ b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h @@ -35,9 +35,13 @@ first error in an appender and ignoring all following errors. <p>This policy aims at protecting an otherwise working application from being flooded with error messages when logging fails */ -class LOG4CXX_EXPORT OnlyOnceErrorHandler : - public virtual spi::ErrorHandler, - public virtual Object +class LOG4CXX_EXPORT OnlyOnceErrorHandler +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual spi::ErrorHandler + , public virtual helpers::Object +#else + : public spi::ErrorHandler +#endif { private: LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(OnlyOnceErrorHandlerPrivate, m_priv) diff --git a/src/main/include/log4cxx/layout.h b/src/main/include/log4cxx/layout.h index 1ede02c4..a83759b8 100644 --- a/src/main/include/log4cxx/layout.h +++ b/src/main/include/log4cxx/layout.h @@ -28,9 +28,13 @@ namespace LOG4CXX_NS /** Extend this abstract class to create your own log layout format. */ -class LOG4CXX_EXPORT Layout : - public virtual spi::OptionHandler, - public virtual helpers::Object +class LOG4CXX_EXPORT Layout +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual spi::OptionHandler + , public virtual helpers::Object +#else + : public spi::OptionHandler +#endif { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(Layout) diff --git a/src/main/include/log4cxx/rolling/rollingpolicybase.h b/src/main/include/log4cxx/rolling/rollingpolicybase.h index d81ae3c6..f2814e04 100644 --- a/src/main/include/log4cxx/rolling/rollingpolicybase.h +++ b/src/main/include/log4cxx/rolling/rollingpolicybase.h @@ -39,9 +39,13 @@ LOG4CXX_LIST_DEF(PatternConverterList, LOG4CXX_NS::pattern::PatternConverterPtr) * * */ -class LOG4CXX_EXPORT RollingPolicyBase : - public virtual RollingPolicy, - public virtual helpers::Object +class LOG4CXX_EXPORT RollingPolicyBase +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual RollingPolicy + , public virtual helpers::Object +#else + : public RollingPolicy +#endif { protected: DECLARE_ABSTRACT_LOG4CXX_OBJECT(RollingPolicyBase) diff --git a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h index 9a5578a1..5d806f08 100755 --- a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h +++ b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h @@ -137,8 +137,14 @@ namespace rolling * the {@link #activateOptions} method of the owning * <code>RollingFileAppender</code>. */ -class LOG4CXX_EXPORT TimeBasedRollingPolicy : public virtual RollingPolicyBase, - public virtual TriggeringPolicy +class LOG4CXX_EXPORT TimeBasedRollingPolicy +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual RollingPolicyBase + , public virtual TriggeringPolicy +#else + : public RollingPolicyBase + , public virtual TriggeringPolicy +#endif { DECLARE_LOG4CXX_OBJECT(TimeBasedRollingPolicy) BEGIN_LOG4CXX_CAST_MAP() diff --git a/src/main/include/log4cxx/rolling/triggeringpolicy.h b/src/main/include/log4cxx/rolling/triggeringpolicy.h index ac6b2dba..15ce1f20 100644 --- a/src/main/include/log4cxx/rolling/triggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/triggeringpolicy.h @@ -41,9 +41,13 @@ namespace rolling * * */ -class LOG4CXX_EXPORT TriggeringPolicy : - public virtual spi::OptionHandler, - public virtual helpers::Object +class LOG4CXX_EXPORT TriggeringPolicy +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual spi::OptionHandler + , public virtual helpers::Object +#else + : public spi::OptionHandler +#endif { DECLARE_ABSTRACT_LOG4CXX_OBJECT(TriggeringPolicy) BEGIN_LOG4CXX_CAST_MAP() diff --git a/src/main/include/log4cxx/spi/defaultrepositoryselector.h b/src/main/include/log4cxx/spi/defaultrepositoryselector.h index 0246c89b..82a31a4b 100644 --- a/src/main/include/log4cxx/spi/defaultrepositoryselector.h +++ b/src/main/include/log4cxx/spi/defaultrepositoryselector.h @@ -27,9 +27,13 @@ namespace LOG4CXX_NS { namespace spi { -class LOG4CXX_EXPORT DefaultRepositorySelector : - public virtual RepositorySelector, - public virtual helpers::Object +class LOG4CXX_EXPORT DefaultRepositorySelector +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual RepositorySelector + , public virtual helpers::Object +#else + : public RepositorySelector +#endif { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(DefaultRepositorySelector) diff --git a/src/main/include/log4cxx/spi/errorhandler.h b/src/main/include/log4cxx/spi/errorhandler.h index a48a6d03..dd11f293 100644 --- a/src/main/include/log4cxx/spi/errorhandler.h +++ b/src/main/include/log4cxx/spi/errorhandler.h @@ -55,7 +55,12 @@ definition errors are hard to predict and to reproduce. that errors are not properly handled. You are most welcome to suggest new error handling policies or criticize existing policies. */ -class LOG4CXX_EXPORT ErrorHandler : public virtual OptionHandler +class LOG4CXX_EXPORT ErrorHandler +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual OptionHandler +#else + : public OptionHandler +#endif { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(ErrorHandler) diff --git a/src/main/include/log4cxx/spi/filter.h b/src/main/include/log4cxx/spi/filter.h index 7049b268..a2d822c4 100644 --- a/src/main/include/log4cxx/spi/filter.h +++ b/src/main/include/log4cxx/spi/filter.h @@ -64,7 +64,12 @@ Linux ipchains. <p>Note that filtering is only supported by the DOMConfigurator. */ -class LOG4CXX_EXPORT Filter : public virtual OptionHandler +class LOG4CXX_EXPORT Filter +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual OptionHandler +#else + : public OptionHandler +#endif { protected: LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FilterPrivate, m_priv) diff --git a/src/main/include/log4cxx/varia/fallbackerrorhandler.h b/src/main/include/log4cxx/varia/fallbackerrorhandler.h index a4599b83..0bcc3d78 100644 --- a/src/main/include/log4cxx/varia/fallbackerrorhandler.h +++ b/src/main/include/log4cxx/varia/fallbackerrorhandler.h @@ -40,8 +40,12 @@ Here is a sample configuration file that installs this error handler: \anchor fallback-ref-example \include async-fall-back-example.xml */ -class LOG4CXX_EXPORT FallbackErrorHandler : - public virtual spi::ErrorHandler +class LOG4CXX_EXPORT FallbackErrorHandler +#if LOG4CXX_ABI_VERSION <= 15 + : public virtual spi::ErrorHandler +#else + : public spi::ErrorHandler +#endif { private: LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FallbackErrorHandlerPrivate, m_priv) diff --git a/src/test/cpp/customlogger/xlogger.h b/src/test/cpp/customlogger/xlogger.h index dca1de40..da32270a 100644 --- a/src/test/cpp/customlogger/xlogger.h +++ b/src/test/cpp/customlogger/xlogger.h @@ -31,9 +31,8 @@ class LocationInfo; } // Any sub-class of Logger must also have its own implementation of // LoggerFactory. -class XFactory : - public virtual spi::LoggerFactory, - public virtual helpers::Object +class XFactory + : public spi::LoggerFactory { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(XFactory) diff --git a/src/test/cpp/net/smtpappendertestcase.cpp b/src/test/cpp/net/smtpappendertestcase.cpp index d3036239..c2934897 100644 --- a/src/test/cpp/net/smtpappendertestcase.cpp +++ b/src/test/cpp/net/smtpappendertestcase.cpp @@ -31,7 +31,7 @@ namespace net { class MockTriggeringEventEvaluator : - public virtual spi::TriggeringEventEvaluator + public spi::TriggeringEventEvaluator { public: DECLARE_LOG4CXX_OBJECT(MockTriggeringEventEvaluator)
