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

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


The following commit(s) were added to refs/heads/next_stable by this push:
     new d74edc6b Prevent MSVC 'needs to have a dll interface' warnings (#117)
d74edc6b is described below

commit d74edc6bbb1b30e0ccf4cd2e7d998a25a4d52e31
Author: Stephen Webb <[email protected]>
AuthorDate: Sat Sep 3 10:05:04 2022 +1000

    Prevent MSVC 'needs to have a dll interface' warnings (#117)
---
 .gitignore                                         |  1 -
 CMakeLists.txt                                     |  2 +
 src/main/cpp/fileappender.cpp                      | 44 +++++-------
 src/main/cpp/objectoutputstream.cpp                | 80 +++++++++++++---------
 src/main/cpp/socketappenderskeleton.cpp            | 15 ++++
 src/main/cpp/sockethubappender.cpp                 | 18 +++--
 src/main/include/log4cxx/appenderskeleton.h        | 18 +----
 src/main/include/log4cxx/config/propertysetter.h   |  4 +-
 src/main/include/log4cxx/fileappender.h            |  9 ---
 .../log4cxx/helpers/appenderattachableimpl.h       | 11 +--
 src/main/include/log4cxx/helpers/bufferedwriter.h  | 12 +---
 .../include/log4cxx/helpers/bytearrayinputstream.h | 12 +---
 .../log4cxx/helpers/bytearrayoutputstream.h        | 16 +----
 src/main/include/log4cxx/helpers/bytebuffer.h      |  4 +-
 .../include/log4cxx/helpers/cacheddateformat.h     | 12 +---
 src/main/include/log4cxx/helpers/cyclicbuffer.h    |  3 +-
 src/main/include/log4cxx/helpers/datagrampacket.h  |  3 +-
 src/main/include/log4cxx/helpers/datagramsocket.h  |  7 +-
 src/main/include/log4cxx/helpers/fileinputstream.h |  3 +-
 .../include/log4cxx/helpers/fileoutputstream.h     |  3 +-
 src/main/include/log4cxx/helpers/filewatchdog.h    |  3 +-
 .../include/log4cxx/helpers/inputstreamreader.h    |  4 ++
 src/main/include/log4cxx/helpers/locale.h          | 11 +--
 src/main/include/log4cxx/helpers/loglog.h          |  3 +-
 src/main/include/log4cxx/helpers/messagebuffer.h   | 12 ++--
 .../include/log4cxx/helpers/objectoutputstream.h   |  8 +--
 src/main/include/log4cxx/helpers/resourcebundle.h  |  8 +++
 src/main/include/log4cxx/helpers/serversocket.h    |  7 +-
 src/main/include/log4cxx/helpers/socket.h          |  7 +-
 .../include/log4cxx/helpers/socketoutputstream.h   | 14 +---
 src/main/include/log4cxx/helpers/stringtokenizer.h | 12 +---
 src/main/include/log4cxx/helpers/syslogwriter.h    | 13 +---
 .../include/log4cxx/helpers/threadspecificdata.h   | 11 +--
 src/main/include/log4cxx/helpers/threadutility.h   |  3 +-
 src/main/include/log4cxx/hierarchy.h               | 12 +---
 src/main/include/log4cxx/htmllayout.h              | 14 +---
 src/main/include/log4cxx/log4cxx.h.in              | 10 +++
 src/main/include/log4cxx/logger.h                  | 16 +----
 .../include/log4cxx/net/socketappenderskeleton.h   | 22 +++---
 src/main/include/log4cxx/pattern/formattinginfo.h  |  3 +-
 .../include/log4cxx/pattern/patternconverter.h     | 15 +---
 src/main/include/log4cxx/patternlayout.h           | 12 +---
 .../include/log4cxx/private/fileappender_priv.h    | 16 ++++-
 src/main/include/log4cxx/rolling/action.h          |  5 +-
 .../log4cxx/rolling/filterbasedtriggeringpolicy.h  |  2 +
 .../include/log4cxx/rolling/rollingpolicybase.h    | 17 +----
 .../log4cxx/spi/defaultrepositoryselector.h        |  3 +-
 src/main/include/log4cxx/spi/filter.h              |  3 +-
 src/main/include/log4cxx/spi/loggingevent.h        | 13 +---
 .../include/log4cxx/varia/fallbackerrorhandler.h   |  3 +-
 src/main/include/log4cxx/xml/domconfigurator.h     | 14 +---
 src/main/include/log4cxx/xml/xmllayout.h           |  3 +-
 52 files changed, 194 insertions(+), 382 deletions(-)

diff --git a/.gitignore b/.gitignore
index dfc659d8..e05c5f7b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@
 *.swp
 
 ar-lib
-config**
 !configuration-samples.md
 depcomp
 install-sh
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bee6dcc8..4791abe1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,10 +73,12 @@ include(GNUInstallDirs)
 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src/main/include/log4cxx
   DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
   FILES_MATCHING PATTERN "*.h"
+  PATTERN "Private" EXCLUDE
 )
 install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/main/include/log4cxx
   DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
   FILES_MATCHING PATTERN "*.h"
+  PATTERN "Private" EXCLUDE
 )
 
 install(TARGETS log4cxx EXPORT log4cxxTargets
diff --git a/src/main/cpp/fileappender.cpp b/src/main/cpp/fileappender.cpp
index 59073e41..991fe32a 100644
--- a/src/main/cpp/fileappender.cpp
+++ b/src/main/cpp/fileappender.cpp
@@ -40,52 +40,42 @@ IMPLEMENT_LOG4CXX_OBJECT(FileAppender)
 FileAppender::FileAppender() :
        WriterAppender (std::make_unique<FileAppenderPriv>())
 {
-       _priv->fileAppend = true;
-       _priv->bufferedIO = false;
-       _priv->bufferSize = 8 * 1024;
 }
 
-FileAppender::FileAppender(const LayoutPtr& layout1, const LogString& 
fileName1,
-       bool append1, bool bufferedIO1, int bufferSize1)
-       : WriterAppender(std::make_unique<FileAppenderPriv>(layout1))
+FileAppender::FileAppender
+       ( const LayoutPtr& layout1
+       , const LogString& fileName1
+       , bool append1
+       , bool bufferedIO1
+       , int bufferSize1
+       )
+       : WriterAppender(std::make_unique<FileAppenderPriv>(layout1, fileName1, 
append1, bufferedIO1, bufferSize1))
 {
-       _priv->fileAppend = append1;
-       _priv->fileName = fileName1;
-       _priv->bufferedIO = bufferedIO1;
-       _priv->bufferSize = bufferSize1;
        Pool p;
        activateOptions(p);
 }
 
-FileAppender::FileAppender(const LayoutPtr& layout1, const LogString& 
fileName1,
-       bool append1)
-       : WriterAppender(std::make_unique<FileAppenderPriv>(layout1))
+FileAppender::FileAppender
+       ( const LayoutPtr& layout1
+       , const LogString& fileName1
+       , bool append1
+       )
+       : WriterAppender(std::make_unique<FileAppenderPriv>(layout1, fileName1, 
append1, false))
 {
-       _priv->fileAppend = append1;
-       _priv->fileName = fileName1;
-       _priv->bufferedIO = false;
-       _priv->bufferSize = 8 * 1024;
        Pool p;
        activateOptions(p);
 }
 
 FileAppender::FileAppender(const LayoutPtr& layout1, const LogString& 
fileName1)
-       : WriterAppender(std::make_unique<FileAppenderPriv>(layout1))
+       : WriterAppender(std::make_unique<FileAppenderPriv>(layout1, fileName1))
 {
-       _priv->fileAppend = true;
-       _priv->fileName = fileName1;
-       _priv->bufferedIO = false;
-       _priv->bufferSize = 8 * 1024;
        Pool p;
        activateOptions(p);
 }
 
-FileAppender::FileAppender(std::unique_ptr<FileAppenderPriv> priv) :
-       WriterAppender (std::move(priv))
+FileAppender::FileAppender(std::unique_ptr<FileAppenderPriv> priv)
+       : WriterAppender (std::move(priv))
 {
-       _priv->fileAppend = true;
-       _priv->bufferedIO = false;
-       _priv->bufferSize = 8 * 1024;
 }
 
 FileAppender::~FileAppender()
diff --git a/src/main/cpp/objectoutputstream.cpp 
b/src/main/cpp/objectoutputstream.cpp
index 6beb1a27..ab9a85b1 100644
--- a/src/main/cpp/objectoutputstream.cpp
+++ b/src/main/cpp/objectoutputstream.cpp
@@ -29,46 +29,60 @@ using namespace log4cxx::helpers;
 
 IMPLEMENT_LOG4CXX_OBJECT(ObjectOutputStream)
 
+typedef std::map<std::string, unsigned int> ClassDescriptionMap;
+
+struct ObjectOutputStream::ObjectOutputStreamPriv
+{
+
+       OutputStreamPtr                     os;
+       log4cxx::helpers::CharsetEncoderPtr utf8Encoder;
+       const   unsigned int                objectHandleDefault;
+       unsigned int                        objectHandle;
+       ClassDescriptionMap                 classDescriptions;
+
+       ObjectOutputStreamPriv(OutputStreamPtr outputStream, Pool& p)
+               : os(outputStream)
+               , utf8Encoder(CharsetEncoder::getUTF8Encoder())
+               , objectHandleDefault(0x7E0000)
+               , objectHandle(objectHandleDefault)
+               {}
+};
+
 ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p)
-       :   os(outputStream),
-               utf8Encoder(CharsetEncoder::getUTF8Encoder()),
-               objectHandleDefault(0x7E0000),
-               objectHandle(objectHandleDefault),
-               classDescriptions(new ClassDescriptionMap())
+       :   m_priv(std::make_unique<ObjectOutputStreamPriv>(outputStream, p))
 {
        unsigned char start[] = { 0xAC, 0xED, 0x00, 0x05 };
        ByteBuffer buf((char*) start, sizeof(start));
-       os->write(buf, p);
+       m_priv->os->write(buf, p);
 }
 
 ObjectOutputStream::~ObjectOutputStream()
 {
-       delete classDescriptions;
 }
 
 void ObjectOutputStream::close(Pool& p)
 {
-       os->close(p);
+       m_priv->os->close(p);
 }
 
 void ObjectOutputStream::flush(Pool& p)
 {
-       os->flush(p);
+       m_priv->os->flush(p);
 }
 
 void ObjectOutputStream::reset(Pool& p)
 {
-       os->flush(p);
+       m_priv->os->flush(p);
        writeByte(TC_RESET, p);
-       os->flush(p);
+       m_priv->os->flush(p);
 
-       objectHandle = objectHandleDefault;
-       classDescriptions->clear();
+       m_priv->objectHandle = m_priv->objectHandleDefault;
+       m_priv->classDescriptions.clear();
 }
 
 void ObjectOutputStream::writeObject(const LogString& val, Pool& p)
 {
-       objectHandle++;
+       m_priv->objectHandle++;
        writeByte(TC_STRING, p);
        char bytes[2];
 #if LOG4CXX_LOGCHAR_IS_UTF8
@@ -79,7 +93,7 @@ void ObjectOutputStream::writeObject(const LogString& val, 
Pool& p)
        char* data = p.pstralloc(maxSize);
        ByteBuffer dataBuf(data, maxSize);
        LogString::const_iterator iter(val.begin());
-       utf8Encoder->encode(val, iter, dataBuf);
+       m_priv->utf8Encoder->encode(val, iter, dataBuf);
        dataBuf.flip();
        size_t len = dataBuf.limit();
 #endif
@@ -87,8 +101,8 @@ void ObjectOutputStream::writeObject(const LogString& val, 
Pool& p)
        bytes[0] = (char) ((len >> 8) & 0xFF);
        ByteBuffer lenBuf(bytes, sizeof(bytes));
 
-       os->write(lenBuf,   p);
-       os->write(dataBuf,  p);
+       m_priv->os->write(lenBuf,   p);
+       m_priv->os->write(dataBuf,  p);
 }
 
 void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p)
@@ -114,7 +128,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, 
Pool& p)
                        TC_BLOCKDATA, 0x08, 0x00, 0x00, 0x00, 0x07
                };
        ByteBuffer dataBuf(data, sizeof(data));
-       os->write(dataBuf, p);
+       m_priv->os->write(dataBuf, p);
 
        char size[4];
        size_t sz = val.size();
@@ -125,7 +139,7 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, 
Pool& p)
        size[0] = (char) ((sz >> 24)    & 0xFF);
 
        ByteBuffer sizeBuf(size, sizeof(size));
-       os->write(sizeBuf, p);
+       m_priv->os->write(sizeBuf, p);
 
        for (MDC::Map::const_iterator   iter  = val.begin();
                iter != val.end();
@@ -143,21 +157,21 @@ void ObjectOutputStream::writeUTFString(const 
std::string& val, Pool& p)
        char bytes[3];
        size_t len = val.size();
        ByteBuffer dataBuf(const_cast<char*>(val.data()), val.size());
-       objectHandle++;
+       m_priv->objectHandle++;
 
        bytes[0] = 0x74;
        bytes[1] = (char) ((len >> 8) & 0xFF);
        bytes[2] = (char) (len & 0xFF);
 
        ByteBuffer lenBuf(bytes, sizeof(bytes));
-       os->write(lenBuf, p);
-       os->write(dataBuf, p);
+       m_priv->os->write(lenBuf, p);
+       m_priv->os->write(dataBuf, p);
 }
 
 void ObjectOutputStream::writeByte(char val, Pool& p)
 {
        ByteBuffer buf(&val, 1);
-       os->write(buf, p);
+       m_priv->os->write(buf, p);
 }
 
 void ObjectOutputStream::writeInt(int val, Pool& p)
@@ -170,7 +184,7 @@ void ObjectOutputStream::writeInt(int val, Pool& p)
        bytes[0] = (char) ((val >> 24) & 0xFF);
 
        ByteBuffer buf(bytes, sizeof(bytes));
-       os->write(buf, p);
+       m_priv->os->write(buf, p);
 }
 
 void ObjectOutputStream::writeLong(log4cxx_time_t val, Pool& p)
@@ -187,13 +201,13 @@ void ObjectOutputStream::writeLong(log4cxx_time_t val, 
Pool& p)
        bytes[0] = (char) ((val >> 56) & 0xFF);
 
        ByteBuffer buf(bytes, sizeof(bytes));
-       os->write(buf, p);
+       m_priv->os->write(buf, p);
 }
 
 void ObjectOutputStream::writeBytes(const char* bytes, size_t len, Pool& p)
 {
        ByteBuffer buf(const_cast<char*>(bytes), len);
-       os->write(buf, p);
+       m_priv->os->write(buf, p);
 }
 
 void ObjectOutputStream::writeNull(Pool& p)
@@ -207,9 +221,9 @@ void ObjectOutputStream::writeProlog(const  char*   
className,
        size_t len,
        Pool&  p)
 {
-       ClassDescriptionMap::const_iterator match = 
classDescriptions->find(className);
+       ClassDescriptionMap::const_iterator match = 
m_priv->classDescriptions.find(className);
 
-       if (match != classDescriptions->end())
+       if (match != m_priv->classDescriptions.end())
        {
                char bytes[6];
 
@@ -221,18 +235,18 @@ void ObjectOutputStream::writeProlog(const  char*   
className,
                bytes[5] = (char) (match->second & 0xFF);
 
                ByteBuffer buf(bytes, sizeof(bytes));
-               os->write(buf, p);
+               m_priv->os->write(buf, p);
 
-               objectHandle++;
+               m_priv->objectHandle++;
        }
        else
        {
-               
classDescriptions->insert(ClassDescriptionMap::value_type(className, 
objectHandle));
+               
m_priv->classDescriptions.insert(ClassDescriptionMap::value_type(className, 
m_priv->objectHandle));
                writeByte(TC_OBJECT, p);
 
                ByteBuffer buf(classDesc, len);
-               os->write(buf, p);
+               m_priv->os->write(buf, p);
 
-               objectHandle += (classDescIncrement + 1);
+               m_priv->objectHandle += (classDescIncrement + 1);
        }
 }
diff --git a/src/main/cpp/socketappenderskeleton.cpp 
b/src/main/cpp/socketappenderskeleton.cpp
index 03d87cc1..544d033d 100644
--- a/src/main/cpp/socketappenderskeleton.cpp
+++ b/src/main/cpp/socketappenderskeleton.cpp
@@ -37,6 +37,21 @@ using namespace log4cxx::net;
 
 #define _priv static_cast<SocketAppenderSkeletonPriv*>(m_priv.get())
 
+SocketAppenderSkeleton::SocketAppenderSkeleton(int defaultPort, int 
reconnectionDelay)
+    : 
AppenderSkeleton(std::make_unique<SocketAppenderSkeletonPriv>(defaultPort, 
reconnectionDelay))
+{
+}
+
+SocketAppenderSkeleton::SocketAppenderSkeleton(helpers::InetAddressPtr 
address, int port, int reconnectionDelay)
+    : AppenderSkeleton(std::make_unique<SocketAppenderSkeletonPriv>(address, 
port, reconnectionDelay))
+{
+}
+
+SocketAppenderSkeleton::SocketAppenderSkeleton(const LogString& host, int 
port, int reconnectionDelay)
+    : AppenderSkeleton(std::make_unique<SocketAppenderSkeletonPriv>(host, 
port, reconnectionDelay))
+{
+}
+
 
SocketAppenderSkeleton::SocketAppenderSkeleton(std::unique_ptr<SocketAppenderSkeletonPriv>
 priv)
        :  AppenderSkeleton (std::move(priv))
 {
diff --git a/src/main/cpp/sockethubappender.cpp 
b/src/main/cpp/sockethubappender.cpp
index ca84f168..62e5ea75 100644
--- a/src/main/cpp/sockethubappender.cpp
+++ b/src/main/cpp/sockethubappender.cpp
@@ -34,16 +34,19 @@
 #include <log4cxx/private/appenderskeleton_priv.h>
 #include <mutex>
 
-using namespace log4cxx;
-using namespace log4cxx::helpers;
-using namespace log4cxx::net;
-using namespace log4cxx::spi;
+namespace log4cxx
+{
+using namespace helpers;
+using namespace spi;
+
+namespace net
+{
 
 IMPLEMENT_LOG4CXX_OBJECT(SocketHubAppender)
 
 int SocketHubAppender::DEFAULT_PORT = 4560;
 
-struct SocketHubAppender::SocketHubAppenderPriv : public 
AppenderSkeletonPrivate
+struct SocketHubAppender::SocketHubAppenderPriv : public 
AppenderSkeleton::AppenderSkeletonPrivate
 {
        SocketHubAppenderPriv(int port) :
                AppenderSkeletonPrivate(),
@@ -286,3 +289,8 @@ bool SocketHubAppender::getLocationInfo() const
 {
        return _priv->locationInfo;
 }
+
+
+} // namespace net
+
+} //namespace log4cxx
diff --git a/src/main/include/log4cxx/appenderskeleton.h 
b/src/main/include/log4cxx/appenderskeleton.h
index 709cdeac..c52110e8 100644
--- a/src/main/include/log4cxx/appenderskeleton.h
+++ b/src/main/include/log4cxx/appenderskeleton.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_APPENDER_SKELETON_H
 #define _LOG4CXX_APPENDER_SKELETON_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/appender.h>
 #include <log4cxx/layout.h>
 #include <log4cxx/spi/errorhandler.h>
@@ -46,8 +40,8 @@ class LOG4CXX_EXPORT AppenderSkeleton :
        public virtual helpers::Object
 {
        protected:
-               struct AppenderSkeletonPrivate;
-               AppenderSkeleton( std::unique_ptr<AppenderSkeletonPrivate> priv 
);
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(AppenderSkeletonPrivate, 
m_priv)
+               AppenderSkeleton(LOG4CXX_PRIVATE_PTR(AppenderSkeletonPrivate) 
priv);
 
                /**
                Subclasses of <code>AppenderSkeleton</code> should implement 
this
@@ -173,15 +167,7 @@ class LOG4CXX_EXPORT AppenderSkeleton :
                */
                void setThreshold(const LevelPtr& threshold);
 
-       protected:
-               std::unique_ptr<AppenderSkeletonPrivate> m_priv;
-
 }; // class AppenderSkeleton
 }  // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
-
 #endif //_LOG4CXX_APPENDER_SKELETON_H
diff --git a/src/main/include/log4cxx/config/propertysetter.h 
b/src/main/include/log4cxx/config/propertysetter.h
index 3c70fb25..58b6f270 100644
--- a/src/main/include/log4cxx/config/propertysetter.h
+++ b/src/main/include/log4cxx/config/propertysetter.h
@@ -26,7 +26,9 @@ namespace log4cxx
 namespace helpers
 {
 class Object;
-typedef std::shared_ptr<Object> ObjectPtr;
+// Instantiate template pointer type passed as parameter
+LOG4CXX_INSTANTIATE_EXPORTED_PTR(Object);
+LOG4CXX_PTR_DEF(Object);
 
 class Properties;
 class Pool;
diff --git a/src/main/include/log4cxx/fileappender.h 
b/src/main/include/log4cxx/fileappender.h
index 19a4ea97..51a58526 100644
--- a/src/main/include/log4cxx/fileappender.h
+++ b/src/main/include/log4cxx/fileappender.h
@@ -24,11 +24,6 @@
 #include <log4cxx/file.h>
 #include <log4cxx/helpers/pool.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace helpers
@@ -216,8 +211,4 @@ LOG4CXX_PTR_DEF(FileAppender);
 
 }  // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif
diff --git a/src/main/include/log4cxx/helpers/appenderattachableimpl.h 
b/src/main/include/log4cxx/helpers/appenderattachableimpl.h
index f8aa46bd..b2e39b00 100644
--- a/src/main/include/log4cxx/helpers/appenderattachableimpl.h
+++ b/src/main/include/log4cxx/helpers/appenderattachableimpl.h
@@ -18,11 +18,6 @@
 #ifndef _LOG4CXX_HELPERS_APPENDER_ATTACHABLE_IMPL_H
 #define _LOG4CXX_HELPERS_APPENDER_ATTACHABLE_IMPL_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 
 #include <log4cxx/spi/appenderattachable.h>
 #include <log4cxx/helpers/object.h>
@@ -110,8 +105,7 @@ class LOG4CXX_EXPORT AppenderAttachableImpl :
                std::mutex& getMutex();
 
        private:
-               struct priv_data;
-               std::unique_ptr<priv_data> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(priv_data, m_priv)
 
                AppenderAttachableImpl(const AppenderAttachableImpl&);
                AppenderAttachableImpl& operator=(const 
AppenderAttachableImpl&);
@@ -122,8 +116,5 @@ LOG4CXX_PTR_DEF(AppenderAttachableImpl);
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
 
 #endif //_LOG4CXX_HELPERS_APPENDER_ATTACHABLE_IMPL_H
diff --git a/src/main/include/log4cxx/helpers/bufferedwriter.h 
b/src/main/include/log4cxx/helpers/bufferedwriter.h
index 685c3d72..49a01d35 100644
--- a/src/main/include/log4cxx/helpers/bufferedwriter.h
+++ b/src/main/include/log4cxx/helpers/bufferedwriter.h
@@ -20,11 +20,6 @@
 
 #include <log4cxx/helpers/writer.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 
@@ -38,8 +33,7 @@ namespace helpers
 class LOG4CXX_EXPORT BufferedWriter : public Writer
 {
        private:
-               struct BufferedWriterPriv;
-               std::unique_ptr<BufferedWriterPriv> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(BufferedWriterPriv, m_priv)
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(BufferedWriter)
@@ -65,8 +59,4 @@ class LOG4CXX_EXPORT BufferedWriter : public Writer
 
 }  //namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_HELPERS_BUFFEREDWRITER_H
diff --git a/src/main/include/log4cxx/helpers/bytearrayinputstream.h 
b/src/main/include/log4cxx/helpers/bytearrayinputstream.h
index a5df60a9..ecacecef 100644
--- a/src/main/include/log4cxx/helpers/bytearrayinputstream.h
+++ b/src/main/include/log4cxx/helpers/bytearrayinputstream.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_HELPERS_BYTEARRAYINPUTSTREAM_H
 #define _LOG4CXX_HELPERS_BYTEARRAYINPUTSTREAM_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <vector>
 #include <log4cxx/helpers/inputstream.h>
 
@@ -41,8 +35,7 @@ LOG4CXX_LIST_DEF(ByteList, unsigned char);
 class LOG4CXX_EXPORT ByteArrayInputStream : public InputStream
 {
        private:
-               struct ByteArrayInputStreamPriv;
-               std::unique_ptr<ByteArrayInputStreamPriv> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(ByteArrayInputStreamPriv, 
m_priv)
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(ByteArrayInputStream)
@@ -88,8 +81,5 @@ LOG4CXX_PTR_DEF(ByteArrayInputStream);
 
 }  //namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
 
 #endif //_LOG4CXX_HELPERS_BYTEARRAYINPUTSTREAM_H
diff --git a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h 
b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
index f4f96c25..56f0c8bf 100644
--- a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
+++ b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
@@ -18,17 +18,9 @@
 #ifndef _LOG4CXX_HELPERS_BYTEARRAYOUTPUTSTREAM_H
 #define _LOG4CXX_HELPERS_BYTEARRAYOUTPUTSTREAM_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
-
 #include <log4cxx/helpers/outputstream.h>
 #include <vector>
 
-
 namespace log4cxx
 {
 
@@ -44,8 +36,7 @@ LOG4CXX_LIST_DEF(ByteList, unsigned char);
 class LOG4CXX_EXPORT ByteArrayOutputStream : public OutputStream
 {
        private:
-               struct ByteArrayOutputStreamPriv;
-               std::unique_ptr<ByteArrayOutputStreamPriv> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(ByteArrayOutputStreamPriv, 
m_priv)
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(ByteArrayOutputStream)
@@ -72,9 +63,4 @@ LOG4CXX_PTR_DEF(ByteArrayOutputStream);
 
 }  //namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
-
 #endif //_LOG4CXX_HELPERS_BYTEARRAYOUTPUTSTREAM_H
diff --git a/src/main/include/log4cxx/helpers/bytebuffer.h 
b/src/main/include/log4cxx/helpers/bytebuffer.h
index 21f89163..926ba145 100644
--- a/src/main/include/log4cxx/helpers/bytebuffer.h
+++ b/src/main/include/log4cxx/helpers/bytebuffer.h
@@ -33,8 +33,7 @@ namespace helpers
 class LOG4CXX_EXPORT ByteBuffer
 {
        private:
-               struct ByteBufferPriv;
-               std::unique_ptr<ByteBufferPriv> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(ByteBufferPriv, m_priv)
 
        public:
                ByteBuffer(char* data, size_t capacity);
@@ -60,7 +59,6 @@ class LOG4CXX_EXPORT ByteBuffer
                ByteBuffer(const ByteBuffer&);
                ByteBuffer& operator=(const ByteBuffer&);
 };
-
 } // namespace helpers
 
 }  //namespace log4cxx
diff --git a/src/main/include/log4cxx/helpers/cacheddateformat.h 
b/src/main/include/log4cxx/helpers/cacheddateformat.h
index 94c543d4..1cff6348 100644
--- a/src/main/include/log4cxx/helpers/cacheddateformat.h
+++ b/src/main/include/log4cxx/helpers/cacheddateformat.h
@@ -20,11 +20,6 @@
 
 #include <log4cxx/helpers/dateformat.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace pattern
@@ -87,8 +82,7 @@ class LOG4CXX_EXPORT CachedDateFormat : public 
log4cxx::helpers::DateFormat
                 */
                static const logchar zeroString[];
 
-               struct CachedDateFormatPriv;
-               std::unique_ptr<CachedDateFormatPriv> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(CachedDateFormatPriv, m_priv)
 
        public:
                /**
@@ -197,8 +191,4 @@ class LOG4CXX_EXPORT CachedDateFormat : public 
log4cxx::helpers::DateFormat
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif // _LOG4CXX_HELPERS_SIMPLE_DATE_FORMAT_H
diff --git a/src/main/include/log4cxx/helpers/cyclicbuffer.h 
b/src/main/include/log4cxx/helpers/cyclicbuffer.h
index 10b96793..d6d76475 100644
--- a/src/main/include/log4cxx/helpers/cyclicbuffer.h
+++ b/src/main/include/log4cxx/helpers/cyclicbuffer.h
@@ -35,8 +35,7 @@ just the first or last element.
 class LOG4CXX_EXPORT CyclicBuffer
 {
        private:
-               struct CyclicBufferPriv;
-               std::unique_ptr<CyclicBufferPriv> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(CyclicBufferPriv, m_priv)
 
        public:
                /**
diff --git a/src/main/include/log4cxx/helpers/datagrampacket.h 
b/src/main/include/log4cxx/helpers/datagrampacket.h
index f4e9e606..46497a4d 100644
--- a/src/main/include/log4cxx/helpers/datagrampacket.h
+++ b/src/main/include/log4cxx/helpers/datagrampacket.h
@@ -36,8 +36,7 @@ and might arrive in any order.
 class LOG4CXX_EXPORT DatagramPacket : public helpers::Object
 {
        private:
-               struct DatagramPacketPriv;
-               std::unique_ptr<DatagramPacketPriv> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(DatagramPacketPriv, m_priv)
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(DatagramPacket)
diff --git a/src/main/include/log4cxx/helpers/datagramsocket.h 
b/src/main/include/log4cxx/helpers/datagramsocket.h
index cbfd29d2..64188ad5 100644
--- a/src/main/include/log4cxx/helpers/datagramsocket.h
+++ b/src/main/include/log4cxx/helpers/datagramsocket.h
@@ -37,10 +37,8 @@ datagram packets.*/
 class LOG4CXX_EXPORT DatagramSocket : public helpers::Object
 {
        protected:
-               struct DatagramSocketPriv;
-               std::unique_ptr<DatagramSocketPriv> m_priv;
-
-               DatagramSocket(std::unique_ptr<DatagramSocketPriv> priv);
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(DatagramSocketPriv, m_priv)
+               DatagramSocket(LOG4CXX_PRIVATE_PTR(DatagramSocketPriv) priv);
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(DatagramSocket)
@@ -103,7 +101,6 @@ class LOG4CXX_EXPORT DatagramSocket : public helpers::Object
        private:
                DatagramSocket(const DatagramSocket&);
                DatagramSocket& operator=(const DatagramSocket&);
-
 };
 
 }  // namespace helpers
diff --git a/src/main/include/log4cxx/helpers/fileinputstream.h 
b/src/main/include/log4cxx/helpers/fileinputstream.h
index d088c4e5..ab907c85 100644
--- a/src/main/include/log4cxx/helpers/fileinputstream.h
+++ b/src/main/include/log4cxx/helpers/fileinputstream.h
@@ -36,8 +36,7 @@ namespace helpers
 class LOG4CXX_EXPORT FileInputStream : public InputStream
 {
        private:
-               struct FileInputStreamPrivate;
-               std::unique_ptr<FileInputStreamPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FileInputStreamPrivate, 
m_priv)
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(FileInputStream)
diff --git a/src/main/include/log4cxx/helpers/fileoutputstream.h 
b/src/main/include/log4cxx/helpers/fileoutputstream.h
index ddade3ef..322d8a77 100644
--- a/src/main/include/log4cxx/helpers/fileoutputstream.h
+++ b/src/main/include/log4cxx/helpers/fileoutputstream.h
@@ -35,8 +35,7 @@ namespace helpers
 class LOG4CXX_EXPORT FileOutputStream : public OutputStream
 {
        private:
-               struct FileOutputStreamPrivate;
-               std::unique_ptr<FileOutputStreamPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FileOutputStreamPrivate, 
m_priv)
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(FileOutputStream)
diff --git a/src/main/include/log4cxx/helpers/filewatchdog.h 
b/src/main/include/log4cxx/helpers/filewatchdog.h
index 7565ef98..51398a3f 100644
--- a/src/main/include/log4cxx/helpers/filewatchdog.h
+++ b/src/main/include/log4cxx/helpers/filewatchdog.h
@@ -66,8 +66,7 @@ class LOG4CXX_EXPORT FileWatchdog
                FileWatchdog(const FileWatchdog&);
                FileWatchdog& operator=(const FileWatchdog&);
 
-               struct FileWatchdogPrivate;
-               std::unique_ptr<FileWatchdogPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FileWatchdogPrivate, m_priv)
 };
 }  // namespace helpers
 } // namespace log4cxx
diff --git a/src/main/include/log4cxx/helpers/inputstreamreader.h 
b/src/main/include/log4cxx/helpers/inputstreamreader.h
index f51d75da..bdd1d5d2 100644
--- a/src/main/include/log4cxx/helpers/inputstreamreader.h
+++ b/src/main/include/log4cxx/helpers/inputstreamreader.h
@@ -28,6 +28,10 @@ namespace log4cxx
 namespace helpers
 {
 
+// Instantiate template pointer types passed as parameters
+LOG4CXX_INSTANTIATE_EXPORTED_PTR(InputStream);
+LOG4CXX_INSTANTIATE_EXPORTED_PTR(CharsetDecoder);
+
 /**
  * Class for reading from character streams.
  * Decorates a byte based InputStream and provides appropriate
diff --git a/src/main/include/log4cxx/helpers/locale.h 
b/src/main/include/log4cxx/helpers/locale.h
index 9dfd55d9..71589b30 100644
--- a/src/main/include/log4cxx/helpers/locale.h
+++ b/src/main/include/log4cxx/helpers/locale.h
@@ -21,11 +21,6 @@
 #include <log4cxx/logstring.h>
 #include <memory>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace helpers
@@ -46,14 +41,10 @@ class LOG4CXX_EXPORT Locale
        protected:
                Locale(const Locale&);
                Locale& operator=(const Locale&);
-               struct LocalePrivate;
-               std::unique_ptr<LocalePrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LocalePrivate, m_priv)
 }; // class Locale
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
 
 #endif // _LOG4CXX_HELPERS_LOCALE_H
diff --git a/src/main/include/log4cxx/helpers/loglog.h 
b/src/main/include/log4cxx/helpers/loglog.h
index 49a8d435..43165066 100644
--- a/src/main/include/log4cxx/helpers/loglog.h
+++ b/src/main/include/log4cxx/helpers/loglog.h
@@ -42,8 +42,7 @@ the string "log4cxx: ".
 class LOG4CXX_EXPORT LogLog
 {
        private:
-               struct LogLogPrivate;
-               std::unique_ptr<LogLogPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LogLogPrivate, m_priv)
 
                LogLog();
                LogLog(const LogLog&);
diff --git a/src/main/include/log4cxx/helpers/messagebuffer.h 
b/src/main/include/log4cxx/helpers/messagebuffer.h
index 80506a9c..b4b65d81 100644
--- a/src/main/include/log4cxx/helpers/messagebuffer.h
+++ b/src/main/include/log4cxx/helpers/messagebuffer.h
@@ -185,8 +185,7 @@ class LOG4CXX_EXPORT CharMessageBuffer
                 */
                CharMessageBuffer& operator=(const CharMessageBuffer&);
 
-               struct CharMessageBufferPrivate;
-               std::unique_ptr<CharMessageBufferPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(CharMessageBufferPrivate, 
m_priv)
 };
 
 template<class V>
@@ -356,8 +355,7 @@ class LOG4CXX_EXPORT UniCharMessageBuffer
                 */
                UniCharMessageBuffer& operator=(const UniCharMessageBuffer&);
 
-               struct UniCharMessageBufferPrivate;
-               std::unique_ptr<UniCharMessageBufferPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(UniCharMessageBufferPrivate, 
m_priv)
 };
 
 template<class V>
@@ -516,8 +514,7 @@ class LOG4CXX_EXPORT WideMessageBuffer
                 */
                WideMessageBuffer& operator=(const WideMessageBuffer&);
 
-               struct WideMessageBufferPrivate;
-               std::unique_ptr<WideMessageBufferPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(WideMessageBufferPrivate, 
m_priv)
 };
 
 template<class V>
@@ -782,8 +779,7 @@ class LOG4CXX_EXPORT MessageBuffer
                 */
                MessageBuffer& operator=(const MessageBuffer&);
 
-               struct MessageBufferPrivate;
-               std::unique_ptr<MessageBufferPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(MessageBufferPrivate, m_priv)
 };
 
 template<class V>
diff --git a/src/main/include/log4cxx/helpers/objectoutputstream.h 
b/src/main/include/log4cxx/helpers/objectoutputstream.h
index 7763770f..3d09bf96 100644
--- a/src/main/include/log4cxx/helpers/objectoutputstream.h
+++ b/src/main/include/log4cxx/helpers/objectoutputstream.h
@@ -84,13 +84,7 @@ class LOG4CXX_EXPORT ObjectOutputStream : public Object
        private:
                ObjectOutputStream(const ObjectOutputStream&);
                ObjectOutputStream& operator=(const ObjectOutputStream&);
-
-               OutputStreamPtr                     os;
-               log4cxx::helpers::CharsetEncoderPtr utf8Encoder;
-               const   unsigned int                        objectHandleDefault;
-               unsigned int                        objectHandle;
-               typedef std::map<std::string, unsigned int> ClassDescriptionMap;
-               ClassDescriptionMap*                classDescriptions;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(ObjectOutputStreamPriv, 
m_priv)
 };
 
 LOG4CXX_PTR_DEF(ObjectOutputStream);
diff --git a/src/main/include/log4cxx/helpers/resourcebundle.h 
b/src/main/include/log4cxx/helpers/resourcebundle.h
index aed5eceb..81fa0ff9 100644
--- a/src/main/include/log4cxx/helpers/resourcebundle.h
+++ b/src/main/include/log4cxx/helpers/resourcebundle.h
@@ -81,7 +81,15 @@ class LOG4CXX_EXPORT ResourceBundle : public Object
                The parent bundle is searched by #getString when this bundle 
does
                not contain a particular resource.
                */
+
+#if defined(_MSC_VER)
+       #pragma warning ( push )
+       #pragma warning ( disable: 4251 )
+#endif
                ResourceBundlePtr parent;
+#if defined(_MSC_VER)
+       #pragma warning (pop)
+#endif
 }; // class ResourceBundle
 }  // namespace helpers
 } // namespace log4cxx
diff --git a/src/main/include/log4cxx/helpers/serversocket.h 
b/src/main/include/log4cxx/helpers/serversocket.h
index c1847a78..276a8569 100644
--- a/src/main/include/log4cxx/helpers/serversocket.h
+++ b/src/main/include/log4cxx/helpers/serversocket.h
@@ -33,8 +33,8 @@ LOG4CXX_UNIQUE_PTR_DEF(ServerSocket);
 class LOG4CXX_EXPORT ServerSocket
 {
        protected:
-               struct ServerSocketPrivate;
-               ServerSocket(std::unique_ptr<ServerSocketPrivate> priv);
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(ServerSocketPrivate, m_priv)
+               ServerSocket(LOG4CXX_PRIVATE_PTR(ServerSocketPrivate) priv);
 
        public:
 
@@ -59,9 +59,6 @@ class LOG4CXX_EXPORT ServerSocket
 
                static ServerSocketUniquePtr create(int port);
 
-       protected:
-               std::unique_ptr<ServerSocketPrivate> m_priv;
-
 };
 }  // namespace helpers
 } // namespace log4cxx
diff --git a/src/main/include/log4cxx/helpers/socket.h 
b/src/main/include/log4cxx/helpers/socket.h
index fd7cadd4..9d6595c7 100644
--- a/src/main/include/log4cxx/helpers/socket.h
+++ b/src/main/include/log4cxx/helpers/socket.h
@@ -43,9 +43,8 @@ local firewall.
 class LOG4CXX_EXPORT Socket : public helpers::Object
 {
        protected:
-               struct SocketPrivate;
-
-               Socket(std::unique_ptr<SocketPrivate>);
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(SocketPrivate, m_priv)
+               Socket(LOG4CXX_PRIVATE_PTR(SocketPrivate) priv);
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(Socket)
@@ -72,8 +71,6 @@ class LOG4CXX_EXPORT Socket : public helpers::Object
                Socket(const Socket&);
                Socket& operator=(const Socket&);
 
-       protected:
-               std::unique_ptr<SocketPrivate> m_priv;
 };
 
 } // namespace helpers
diff --git a/src/main/include/log4cxx/helpers/socketoutputstream.h 
b/src/main/include/log4cxx/helpers/socketoutputstream.h
index 90000df6..b2750869 100644
--- a/src/main/include/log4cxx/helpers/socketoutputstream.h
+++ b/src/main/include/log4cxx/helpers/socketoutputstream.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_HELPERS_SOCKET_OUTPUT_STREAM_H
 #define _LOG4CXX_HELPERS_SOCKET_OUTPUT_STREAM_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/outputstream.h>
 #include <log4cxx/helpers/socket.h>
@@ -51,8 +45,7 @@ class LOG4CXX_EXPORT SocketOutputStream : public OutputStream
                virtual void write(ByteBuffer& buf, Pool& p);
 
        private:
-               struct SocketOutputStreamPrivate;
-               std::unique_ptr<SocketOutputStreamPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(SocketOutputStreamPrivate, 
m_priv)
                //
                //   prevent copy and assignment statements
                SocketOutputStream(const SocketOutputStream&);
@@ -65,10 +58,5 @@ LOG4CXX_PTR_DEF(SocketOutputStream);
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
-
 
 #endif // _LOG4CXX_HELPERS_SOCKET_OUTPUT_STREAM_H
diff --git a/src/main/include/log4cxx/helpers/stringtokenizer.h 
b/src/main/include/log4cxx/helpers/stringtokenizer.h
index c915420d..e9defb96 100644
--- a/src/main/include/log4cxx/helpers/stringtokenizer.h
+++ b/src/main/include/log4cxx/helpers/stringtokenizer.h
@@ -21,11 +21,6 @@
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/exception.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace helpers
@@ -43,14 +38,9 @@ class LOG4CXX_EXPORT StringTokenizer
                StringTokenizer(const StringTokenizer&);
                StringTokenizer& operator=(const StringTokenizer&);
 
-               struct StringTokenizerPrivate;
-               std::unique_ptr<StringTokenizerPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(StringTokenizerPrivate, 
m_priv)
 }; // class StringTokenizer
 }  // namespace helpers;
 } // namespace log4cxx;
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_HELPERS_STRING_TOKENIZER_H
diff --git a/src/main/include/log4cxx/helpers/syslogwriter.h 
b/src/main/include/log4cxx/helpers/syslogwriter.h
index 547459bc..b5945250 100644
--- a/src/main/include/log4cxx/helpers/syslogwriter.h
+++ b/src/main/include/log4cxx/helpers/syslogwriter.h
@@ -18,16 +18,10 @@
 #ifndef _LOG4CXX_SYSLOG_WRITER_H
 #define _LOG4CXX_SYSLOG_WRITER_H
 
-
 #include <log4cxx/helpers/object.h>
 #include <log4cxx/helpers/inetaddress.h>
 #include <log4cxx/helpers/datagramsocket.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace helpers
@@ -45,14 +39,9 @@ class LOG4CXX_EXPORT SyslogWriter
                void write(const LogString& string);
 
        private:
-               struct SyslogWriterPrivate;
-               std::unique_ptr<SyslogWriterPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(SyslogWriterPrivate, m_priv)
 };
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif
diff --git a/src/main/include/log4cxx/helpers/threadspecificdata.h 
b/src/main/include/log4cxx/helpers/threadspecificdata.h
index e1bb2d83..461797d6 100644
--- a/src/main/include/log4cxx/helpers/threadspecificdata.h
+++ b/src/main/include/log4cxx/helpers/threadspecificdata.h
@@ -21,11 +21,6 @@
 #include <log4cxx/ndc.h>
 #include <log4cxx/mdc.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace helpers
@@ -61,15 +56,11 @@ class LOG4CXX_EXPORT ThreadSpecificData
        private:
                static ThreadSpecificData& getDataNoThreads();
                static ThreadSpecificData* createCurrentData();
-               struct ThreadSpecificDataPrivate;
-               std::unique_ptr<ThreadSpecificDataPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(ThreadSpecificDataPrivate, 
m_priv)
 };
 
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
 
 #endif
diff --git a/src/main/include/log4cxx/helpers/threadutility.h 
b/src/main/include/log4cxx/helpers/threadutility.h
index e9b1d823..498bcba3 100644
--- a/src/main/include/log4cxx/helpers/threadutility.h
+++ b/src/main/include/log4cxx/helpers/threadutility.h
@@ -75,8 +75,7 @@ class LOG4CXX_EXPORT ThreadUtility
                log4cxx::helpers::ThreadStarted threadStartedFunction();
                log4cxx::helpers::ThreadStartPost postStartFunction();
 
-               struct priv_data;
-               std::unique_ptr<priv_data> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(priv_data, m_priv)
 
        public:
                ~ThreadUtility();
diff --git a/src/main/include/log4cxx/hierarchy.h 
b/src/main/include/log4cxx/hierarchy.h
index 72120bd0..96aa3ca0 100644
--- a/src/main/include/log4cxx/hierarchy.h
+++ b/src/main/include/log4cxx/hierarchy.h
@@ -18,10 +18,6 @@
 #ifndef _LOG4CXX_HIERARCHY_H
 #define _LOG4CXX_HIERARCHY_H
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/spi/loggerrepository.h>
 #include <log4cxx/spi/loggerfactory.h>
@@ -62,8 +58,7 @@ class LOG4CXX_EXPORT Hierarchy :
        public std::enable_shared_from_this<Hierarchy>
 {
        private:
-               struct HierarchyPrivate;
-               std::unique_ptr<HierarchyPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(HierarchyPrivate, m_priv)
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(Hierarchy)
@@ -273,9 +268,4 @@ class LOG4CXX_EXPORT Hierarchy :
 
 }  //namespace log4cxx
 
-
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_HIERARCHY_H
diff --git a/src/main/include/log4cxx/htmllayout.h 
b/src/main/include/log4cxx/htmllayout.h
index c0bf1ac6..eb1e878b 100644
--- a/src/main/include/log4cxx/htmllayout.h
+++ b/src/main/include/log4cxx/htmllayout.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_HTML_LAYOUT_H
 #define _LOG4CXX_HTML_LAYOUT_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/layout.h>
 #include <log4cxx/helpers/iso8601dateformat.h>
 
@@ -37,8 +31,7 @@ This layout outputs events in a HTML table.
 class LOG4CXX_EXPORT HTMLLayout : public Layout
 {
        private:
-               struct HTMLLayoutPrivate;
-               std::unique_ptr<HTMLLayoutPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(HTMLLayoutPrivate, m_priv)
 
        public:
                DECLARE_LOG4CXX_OBJECT(HTMLLayout)
@@ -117,9 +110,4 @@ class LOG4CXX_EXPORT HTMLLayout : public Layout
 LOG4CXX_PTR_DEF(HTMLLayout);
 }  // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
-
 #endif // _LOG4CXX_HTML_LAYOUT_H
diff --git a/src/main/include/log4cxx/log4cxx.h.in 
b/src/main/include/log4cxx/log4cxx.h.in
index e350d831..663157a6 100644
--- a/src/main/include/log4cxx/log4cxx.h.in
+++ b/src/main/include/log4cxx/log4cxx.h.in
@@ -64,8 +64,15 @@ typedef unsigned int log4cxx_uint32_t;
        typedef std::weak_ptr<T> T##WeakPtr
 #define LOG4CXX_UNIQUE_PTR_DEF(T) typedef std::unique_ptr<T> T##UniquePtr;
 #define LOG4CXX_LIST_DEF(N, T) typedef std::vector<T> N
+#define LOG4CXX_PRIVATE_PTR(T) std::unique_ptr<T>
 
 #if _WIN32
+#define LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(T, V) \
+__pragma( warning( push ) ) \
+__pragma( warning( disable : 4251 ) ) \
+    struct T; LOG4CXX_PRIVATE_PTR(T) V; \
+__pragma( warning( pop ) )
+
 //  definitions used when using static library
 #if defined(LOG4CXX_STATIC)
 #define LOG4CXX_EXPORT
@@ -76,8 +83,11 @@ typedef unsigned int log4cxx_uint32_t;
 //    definitions used when using DLL
 #define LOG4CXX_EXPORT __declspec(dllimport)
 #endif
+#define LOG4CXX_INSTANTIATE_EXPORTED_PTR(T) template class LOG4CXX_EXPORT 
std::shared_ptr<T>
 #else
 #define LOG4CXX_EXPORT
+#define LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(T, V) struct T; 
LOG4CXX_PRIVATE_PTR(T) V;
+#define LOG4CXX_INSTANTIATE_EXPORTED_PTR(T)
 #endif /* WIN32 */
 
 namespace log4cxx {
diff --git a/src/main/include/log4cxx/logger.h 
b/src/main/include/log4cxx/logger.h
index e8b40c3c..2f56de12 100644
--- a/src/main/include/log4cxx/logger.h
+++ b/src/main/include/log4cxx/logger.h
@@ -18,15 +18,6 @@
 #ifndef _LOG4CXX_LOGGER_H
 #define _LOG4CXX_LOGGER_H
 
-#if defined(_MSC_VER) && (_MSC_VER < 1900)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4127 )
-#endif
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/helpers/appenderattachableimpl.h>
 #include <log4cxx/level.h>
 #include <log4cxx/helpers/pool.h>
@@ -72,8 +63,7 @@ class LOG4CXX_EXPORT Logger :
                END_LOG4CXX_CAST_MAP()
 
        private:
-               struct LoggerPrivate;
-               std::unique_ptr<LoggerPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LoggerPrivate, m_priv)
 
        protected:
                friend class DefaultLoggerFactory;
@@ -1984,10 +1974,6 @@ Logs a localized message with three parameters.
 
 /**@}*/
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #include <log4cxx/spi/loggerrepository.h>
 
 #endif //_LOG4CXX_LOGGER_H
diff --git a/src/main/include/log4cxx/net/socketappenderskeleton.h 
b/src/main/include/log4cxx/net/socketappenderskeleton.h
index 95991dcf..48780196 100644
--- a/src/main/include/log4cxx/net/socketappenderskeleton.h
+++ b/src/main/include/log4cxx/net/socketappenderskeleton.h
@@ -24,11 +24,6 @@
 #include <thread>
 #include <condition_variable>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 
@@ -44,9 +39,19 @@ class LOG4CXX_EXPORT SocketAppenderSkeleton : public 
AppenderSkeleton
                struct SocketAppenderSkeletonPriv;
 
        public:
-               
SocketAppenderSkeleton(std::unique_ptr<SocketAppenderSkeletonPriv> priv);
+               SocketAppenderSkeleton(int defaultPort, int reconnectionDelay);
                ~SocketAppenderSkeleton();
 
+               /**
+               Connects to remote server at <code>address</code> and 
<code>port</code>.
+               */
+               SocketAppenderSkeleton(helpers::InetAddressPtr address, int 
port, int reconnectionDelay);
+
+               /**
+               Connects to remote server at <code>host</code> and 
<code>port</code>.
+               */
+               SocketAppenderSkeleton(const LogString& host, int port, int 
reconnectionDelay);
+
                /**
                Connect to the specified <b>RemoteHost</b> and <b>Port</b>.
                */
@@ -122,6 +127,7 @@ class LOG4CXX_EXPORT SocketAppenderSkeleton : public 
AppenderSkeleton
                        const LogString& value);
 
        protected:
+               
SocketAppenderSkeleton(std::unique_ptr<SocketAppenderSkeletonPriv> priv);
 
                virtual void setSocket(log4cxx::helpers::SocketPtr& socket, 
log4cxx::helpers::Pool& p) = 0;
 
@@ -152,9 +158,5 @@ class LOG4CXX_EXPORT SocketAppenderSkeleton : public 
AppenderSkeleton
 } // namespace net
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif // _LOG4CXX_NET_SOCKET_APPENDER_SKELETON_H
 
diff --git a/src/main/include/log4cxx/pattern/formattinginfo.h 
b/src/main/include/log4cxx/pattern/formattinginfo.h
index 372bcd74..5fce1386 100644
--- a/src/main/include/log4cxx/pattern/formattinginfo.h
+++ b/src/main/include/log4cxx/pattern/formattinginfo.h
@@ -42,8 +42,7 @@ typedef std::shared_ptr<FormattingInfo> FormattingInfoPtr;
  */
 class LOG4CXX_EXPORT FormattingInfo : public virtual log4cxx::helpers::Object
 {
-               struct FormattingInfoPrivate;
-               std::unique_ptr<FormattingInfoPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FormattingInfoPrivate, 
m_priv)
 
        public:
                DECLARE_ABSTRACT_LOG4CXX_OBJECT(FormattingInfo)
diff --git a/src/main/include/log4cxx/pattern/patternconverter.h 
b/src/main/include/log4cxx/pattern/patternconverter.h
index af041629..05916f45 100644
--- a/src/main/include/log4cxx/pattern/patternconverter.h
+++ b/src/main/include/log4cxx/pattern/patternconverter.h
@@ -23,11 +23,6 @@
 #include <log4cxx/logstring.h>
 #include <vector>
 
-#ifdef _MSC_VER
-       //   disable identifier too wide for debugging warning
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #define DECLARE_LOG4CXX_PATTERN(cls) DECLARE_ABSTRACT_LOG4CXX_OBJECT(cls)
 
 namespace log4cxx
@@ -50,14 +45,8 @@ typedef std::vector<LogString> OptionsList;
 class LOG4CXX_EXPORT PatternConverter : public virtual log4cxx::helpers::Object
 {
        protected:
-               struct PatternConverterPrivate;
-               std::unique_ptr<PatternConverterPrivate> m_priv;
-
-               /**
-                * Use this constructor when you have a subclass that has its 
own private data
-                * @param priv
-                */
-               PatternConverter(std::unique_ptr<PatternConverterPrivate> priv);
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(PatternConverterPrivate, 
m_priv)
+               PatternConverter(LOG4CXX_PRIVATE_PTR(PatternConverterPrivate) 
priv);
 
                /**
                 * Create a new pattern converter.  Use this constructor when 
you have a subclass
diff --git a/src/main/include/log4cxx/patternlayout.h 
b/src/main/include/log4cxx/patternlayout.h
index 3f8106c3..fb055e69 100644
--- a/src/main/include/log4cxx/patternlayout.h
+++ b/src/main/include/log4cxx/patternlayout.h
@@ -18,11 +18,6 @@
 #ifndef _LOG4CXX_PATTERN_LAYOUT_H
 #define _LOG4CXX_PATTERN_LAYOUT_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/layout.h>
 #include <log4cxx/pattern/loggingeventpatternconverter.h>
 #include <log4cxx/pattern/formattinginfo.h>
@@ -362,8 +357,7 @@ LOG4CXX_LIST_DEF(FormattingInfoList, 
log4cxx::pattern::FormattingInfoPtr);
  */
 class LOG4CXX_EXPORT PatternLayout : public Layout
 {
-               struct PatternLayoutPrivate;
-               std::unique_ptr<PatternLayoutPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(PatternLayoutPrivate, m_priv)
 
        public:
                DECLARE_LOG4CXX_OBJECT(PatternLayout)
@@ -427,8 +421,4 @@ class LOG4CXX_EXPORT PatternLayout : public Layout
 LOG4CXX_PTR_DEF(PatternLayout);
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif //_LOG4CXX_PATTERN_LAYOUT_H
diff --git a/src/main/include/log4cxx/private/fileappender_priv.h 
b/src/main/include/log4cxx/private/fileappender_priv.h
index e035e6ac..58918c7c 100644
--- a/src/main/include/log4cxx/private/fileappender_priv.h
+++ b/src/main/include/log4cxx/private/fileappender_priv.h
@@ -26,9 +26,19 @@ namespace log4cxx
 
 struct FileAppender::FileAppenderPriv : public 
WriterAppender::WriterAppenderPriv
 {
-       FileAppenderPriv() : WriterAppenderPriv() {}
-
-       FileAppenderPriv(LayoutPtr layout) : WriterAppenderPriv(layout) {}
+       FileAppenderPriv
+               ( LayoutPtr _layout = LayoutPtr()
+               , const LogString& _fileName = LogString()
+               , bool _fileAppend = true
+               , bool _bufferedIO = false
+               , int _bufferSize = 8 * 1024
+               )
+               : WriterAppenderPriv(_layout)
+               , fileAppend(_fileAppend)
+               , fileName(_fileName)
+               , bufferedIO(_bufferedIO)
+               , bufferSize(_bufferSize)
+               {}
 
        /** Append to or truncate the file? The default value for this
        variable is <code>true</code>, meaning that by default a
diff --git a/src/main/include/log4cxx/rolling/action.h 
b/src/main/include/log4cxx/rolling/action.h
index a69f326a..8b9d9eab 100644
--- a/src/main/include/log4cxx/rolling/action.h
+++ b/src/main/include/log4cxx/rolling/action.h
@@ -39,15 +39,14 @@ class Action : public virtual log4cxx::helpers::Object
                LOG4CXX_CAST_ENTRY(Action)
                END_LOG4CXX_CAST_MAP()
 
-               struct ActionPrivate;
-               std::unique_ptr<ActionPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(ActionPrivate, m_priv)
 
        protected:
                /**
                 * Constructor.
                 */
                Action();
-               Action( std::unique_ptr<ActionPrivate> priv );
+               Action(LOG4CXX_PRIVATE_PTR(ActionPrivate) priv);
                virtual ~Action();
 
        public:
diff --git a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h 
b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h
index 1b910ec5..3cb6a427 100644
--- a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h
+++ b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h
@@ -35,6 +35,8 @@ class Pool;
 namespace rolling
 {
 
+// Instantiate template pointer types passed as parameters
+LOG4CXX_INSTANTIATE_EXPORTED_PTR(log4cxx::spi::Filter);
 
 /**
  * FilterBasedTriggeringPolicy determines if rolling should be triggered
diff --git a/src/main/include/log4cxx/rolling/rollingpolicybase.h 
b/src/main/include/log4cxx/rolling/rollingpolicybase.h
index 205ab6d0..d6d73182 100644
--- a/src/main/include/log4cxx/rolling/rollingpolicybase.h
+++ b/src/main/include/log4cxx/rolling/rollingpolicybase.h
@@ -18,12 +18,6 @@
 #if !defined(_LOG4CXX_ROLLING_ROLLING_POLICY_BASE_H)
 #define _LOG4CXX_ROLLING_ROLLING_POLICY_BASE_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/helpers/object.h>
 #include <log4cxx/logger.h>
 #include <log4cxx/logmanager.h>
@@ -57,13 +51,10 @@ class LOG4CXX_EXPORT RollingPolicyBase :
                LOG4CXX_CAST_ENTRY(spi::OptionHandler)
                END_LOG4CXX_CAST_MAP()
 
-
-               struct RollingPolicyBasePrivate;
-               std::unique_ptr<RollingPolicyBasePrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(RollingPolicyBasePrivate, 
m_priv)
 
        public:
                RollingPolicyBase();
-               RollingPolicyBase( std::unique_ptr<RollingPolicyBasePrivate> 
priv );
                virtual ~RollingPolicyBase();
                virtual void activateOptions(log4cxx::helpers::Pool& p) = 0;
                virtual log4cxx::pattern::PatternMap getFormatSpecifiers() 
const = 0;
@@ -94,6 +85,7 @@ class LOG4CXX_EXPORT RollingPolicyBase :
                }
 #endif
        protected:
+               RollingPolicyBase(LOG4CXX_PRIVATE_PTR(RollingPolicyBasePrivate) 
priv);
                /**
                 *   Parse file name pattern.
                 */
@@ -115,9 +107,4 @@ class LOG4CXX_EXPORT RollingPolicyBase :
 }
 }
 
-
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif
diff --git a/src/main/include/log4cxx/spi/defaultrepositoryselector.h 
b/src/main/include/log4cxx/spi/defaultrepositoryselector.h
index 1e22fed5..8059f4d0 100644
--- a/src/main/include/log4cxx/spi/defaultrepositoryselector.h
+++ b/src/main/include/log4cxx/spi/defaultrepositoryselector.h
@@ -42,8 +42,7 @@ class LOG4CXX_EXPORT DefaultRepositorySelector :
                virtual LoggerRepositoryPtr getLoggerRepository();
 
        private:
-               struct DefaultRepositorySelectorPrivate;
-               std::unique_ptr<DefaultRepositorySelectorPrivate> m_priv;
+               
LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(DefaultRepositorySelectorPrivate, m_priv)
 };
 }  // namespace spi
 } // namespace log4cxx
diff --git a/src/main/include/log4cxx/spi/filter.h 
b/src/main/include/log4cxx/spi/filter.h
index 6130526b..6c2dfe59 100644
--- a/src/main/include/log4cxx/spi/filter.h
+++ b/src/main/include/log4cxx/spi/filter.h
@@ -69,8 +69,7 @@ class LOG4CXX_EXPORT Filter : public virtual OptionHandler,
        public virtual helpers::Object
 {
        protected:
-               struct FilterPrivate;
-               std::unique_ptr<FilterPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FilterPrivate, m_priv)
 
        public:
                Filter();
diff --git a/src/main/include/log4cxx/spi/loggingevent.h 
b/src/main/include/log4cxx/spi/loggingevent.h
index d3fded32..d036f40b 100644
--- a/src/main/include/log4cxx/spi/loggingevent.h
+++ b/src/main/include/log4cxx/spi/loggingevent.h
@@ -18,11 +18,6 @@
 #ifndef _LOG4CXX_SPI_LOGGING_EVENT_H
 #define _LOG4CXX_SPI_LOGGING_EVENT_H
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 #include <time.h>
 #include <log4cxx/logger.h>
@@ -180,8 +175,7 @@ class LOG4CXX_EXPORT LoggingEvent :
                void setProperty(const LogString& key, const LogString& value);
 
        private:
-               struct LoggingEventPrivate;
-               std::unique_ptr<LoggingEventPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LoggingEventPrivate, m_priv)
 
                //
                //   prevent copy and assignment
@@ -198,9 +192,4 @@ LOG4CXX_LIST_DEF(LoggingEventList, LoggingEventPtr);
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
-
 #endif //_LOG4CXX_SPI_LOGGING_EVENT_H
diff --git a/src/main/include/log4cxx/varia/fallbackerrorhandler.h 
b/src/main/include/log4cxx/varia/fallbackerrorhandler.h
index 42395c32..e49e638b 100644
--- a/src/main/include/log4cxx/varia/fallbackerrorhandler.h
+++ b/src/main/include/log4cxx/varia/fallbackerrorhandler.h
@@ -42,8 +42,7 @@ class LOG4CXX_EXPORT FallbackErrorHandler :
        public virtual helpers::Object
 {
        private:
-               struct FallbackErrorHandlerPrivate;
-               std::unique_ptr<FallbackErrorHandlerPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FallbackErrorHandlerPrivate, 
m_priv)
 
        public:
                DECLARE_LOG4CXX_OBJECT(FallbackErrorHandler)
diff --git a/src/main/include/log4cxx/xml/domconfigurator.h 
b/src/main/include/log4cxx/xml/domconfigurator.h
index 0c4d6d16..5c19079e 100644
--- a/src/main/include/log4cxx/xml/domconfigurator.h
+++ b/src/main/include/log4cxx/xml/domconfigurator.h
@@ -18,13 +18,6 @@
 #ifndef _LOG4CXX_XML_DOM_CONFIGURATOR_H
 #define _LOG4CXX_XML_DOM_CONFIGURATOR_H
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
-
 #include <log4cxx/logstring.h>
 #include <map>
 #include <log4cxx/appender.h>
@@ -301,15 +294,10 @@ class LOG4CXX_EXPORT DOMConfigurator :
                DOMConfigurator& operator=(const DOMConfigurator&);
                static XMLWatchdog* xdog;
 
-               struct DOMConfiguratorPrivate;
-               std::unique_ptr<DOMConfiguratorPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(DOMConfiguratorPrivate, 
m_priv)
 };
 LOG4CXX_PTR_DEF(DOMConfigurator);
 }  // namespace xml
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif // _LOG4CXX_XML_DOM_CONFIGURATOR_H
diff --git a/src/main/include/log4cxx/xml/xmllayout.h 
b/src/main/include/log4cxx/xml/xmllayout.h
index ffe0a13d..90eda790 100644
--- a/src/main/include/log4cxx/xml/xmllayout.h
+++ b/src/main/include/log4cxx/xml/xmllayout.h
@@ -53,8 +53,7 @@ appender where it is embedded.
 class LOG4CXX_EXPORT XMLLayout : public Layout
 {
        private:
-               struct XMLLayoutPrivate;
-               std::unique_ptr<XMLLayoutPrivate> m_priv;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(XMLLayoutPrivate, m_priv)
 
        public:
                DECLARE_LOG4CXX_OBJECT(XMLLayout)

Reply via email to