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

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


The following commit(s) were added to refs/heads/remove_redundant_pragmas by 
this push:
     new ec553e80 Prevent MSVC warnings with specifically targeted macros 
instead of file level pragmas
ec553e80 is described below

commit ec553e802eeb15491c254a2a56ef04ea34e350fc
Author: Stephen Webb <[email protected]>
AuthorDate: Sat Nov 26 13:09:35 2022 +1100

    Prevent MSVC warnings with specifically targeted macros instead of file 
level pragmas
---
 src/main/cpp/class.cpp                             |  4 --
 src/main/cpp/classnamepatternconverter.cpp         |  4 --
 src/main/cpp/colorendpatternconverter.cpp          |  3 -
 src/main/cpp/colorstartpatternconverter.cpp        |  3 -
 src/main/cpp/datepatternconverter.cpp              |  4 --
 src/main/cpp/filedatepatternconverter.cpp          |  3 -
 src/main/cpp/filelocationpatternconverter.cpp      |  5 --
 src/main/cpp/fulllocationpatternconverter.cpp      |  4 --
 src/main/cpp/inetaddress.cpp                       |  3 -
 src/main/cpp/integerpatternconverter.cpp           |  4 --
 src/main/cpp/levelpatternconverter.cpp             |  3 -
 src/main/cpp/linelocationpatternconverter.cpp      |  3 -
 src/main/cpp/lineseparatorpatternconverter.cpp     |  4 --
 src/main/cpp/literalpatternconverter.cpp           |  3 -
 src/main/cpp/loggerpatternconverter.cpp            |  3 -
 src/main/cpp/loggingeventpatternconverter.cpp      |  3 -
 src/main/cpp/logmanager.cpp                        |  5 --
 src/main/cpp/messagepatternconverter.cpp           |  5 --
 src/main/cpp/methodlocationpatternconverter.cpp    |  5 --
 src/main/cpp/multiprocessrollingfileappender.cpp   |  5 --
 src/main/cpp/namepatternconverter.cpp              |  4 --
 src/main/cpp/ndc.cpp                               |  5 --
 src/main/cpp/ndcpatternconverter.cpp               |  6 --
 src/main/cpp/nteventlogappender.cpp                |  4 +-
 src/main/cpp/objectoutputstream.cpp                |  3 -
 src/main/cpp/patternconverter.cpp                  |  3 -
 src/main/cpp/patternlayout.cpp                     |  3 -
 src/main/cpp/propertiespatternconverter.cpp        |  4 --
 src/main/cpp/relativetimepatternconverter.cpp      |  4 --
 src/main/cpp/rollingfileappender.cpp               |  4 --
 src/main/cpp/rollingpolicybase.cpp                 |  4 --
 src/main/cpp/shortfilelocationpatternconverter.cpp |  3 -
 src/main/cpp/socketappenderskeleton.cpp            |  3 -
 src/main/cpp/sockethubappender.cpp                 |  3 -
 src/main/cpp/syslogwriter.cpp                      |  5 +-
 src/main/cpp/threadpatternconverter.cpp            |  3 -
 src/main/cpp/threadusernamepatternconverter.cpp    |  3 -
 .../cpp/throwableinformationpatternconverter.cpp   |  5 --
 src/main/cpp/timebasedrollingpolicy.cpp            |  3 -
 src/main/cpp/timezone.cpp                          |  4 --
 src/main/include/log4cxx/appender.h                | 10 ----
 src/main/include/log4cxx/asyncappender.h           | 11 ----
 src/main/include/log4cxx/config_msvc.h.in          | 69 ----------------------
 src/main/include/log4cxx/consoleappender.h         |  9 ---
 src/main/include/log4cxx/db/odbcappender.h         | 10 ----
 src/main/include/log4cxx/file.h                    | 12 +---
 src/main/include/log4cxx/filter/andfilter.h        | 10 ----
 src/main/include/log4cxx/filter/denyallfilter.h    | 11 ----
 src/main/include/log4cxx/filter/expressionfilter.h | 14 +----
 src/main/include/log4cxx/filter/levelmatchfilter.h | 10 ----
 .../include/log4cxx/filter/locationinfofilter.h    |  4 +-
 .../include/log4cxx/filter/loggermatchfilter.h     | 10 ----
 src/main/include/log4cxx/filter/mapfilter.h        |  8 ---
 src/main/include/log4cxx/filter/propertyfilter.h   | 10 ----
 .../include/log4cxx/filter/stringmatchfilter.h     |  8 ---
 src/main/include/log4cxx/helpers/class.h           | 11 ----
 src/main/include/log4cxx/helpers/exception.h       |  2 +-
 src/main/include/log4cxx/helpers/inetaddress.h     | 19 +-----
 src/main/include/log4cxx/helpers/messagebuffer.h   |  9 ---
 .../include/log4cxx/helpers/onlyonceerrorhandler.h | 13 +---
 src/main/include/log4cxx/helpers/properties.h      | 10 ----
 src/main/include/log4cxx/helpers/resourcebundle.h  |  9 +--
 .../include/log4cxx/helpers/simpledateformat.h     | 17 +-----
 .../include/log4cxx/helpers/strftimedateformat.h   | 13 +---
 src/main/include/log4cxx/helpers/timezone.h        | 11 +---
 src/main/include/log4cxx/helpers/transcoder.h      |  9 ---
 src/main/include/log4cxx/helpers/xml.h             | 11 ----
 src/main/include/log4cxx/jsonlayout.h              | 13 +---
 src/main/include/log4cxx/layout.h                  | 10 ----
 src/main/include/log4cxx/level.h                   | 12 +---
 src/main/include/log4cxx/log4cxx.h.in              |  7 +++
 src/main/include/log4cxx/logmanager.h              |  9 ---
 src/main/include/log4cxx/logstring.h               | 12 ----
 src/main/include/log4cxx/mdc.h                     | 11 +---
 src/main/include/log4cxx/ndc.h                     | 10 ----
 src/main/include/log4cxx/net/smtpappender.h        |  9 ---
 src/main/include/log4cxx/net/sockethubappender.h   | 11 ----
 src/main/include/log4cxx/net/syslogappender.h      |  9 ---
 src/main/include/log4cxx/net/telnetappender.h      | 12 ----
 src/main/include/log4cxx/nt/nteventlogappender.h   |  9 ---
 .../log4cxx/pattern/literalpatternconverter.h      |  9 ---
 src/main/include/log4cxx/pattern/patternparser.h   | 12 ----
 src/main/include/log4cxx/propertyconfigurator.h    | 13 +---
 .../include/log4cxx/rolling/gzcompressaction.h     |  9 ---
 .../include/log4cxx/rolling/rolloverdescription.h  |  2 +-
 .../log4cxx/rolling/timebasedrollingpolicy.h       | 14 +----
 .../include/log4cxx/rolling/zipcompressaction.h    | 10 ----
 src/main/include/log4cxx/simplelayout.h            | 11 ----
 src/main/include/log4cxx/spi/appenderattachable.h  |  8 ---
 src/main/include/log4cxx/spi/errorhandler.h        | 10 ----
 .../include/log4cxx/spi/hierarchyeventlistener.h   | 10 ----
 src/main/include/log4cxx/spi/loggerrepository.h    | 11 ----
 src/main/include/log4cxx/writerappender.h          |  9 ---
 src/test/cpp/logunit.cpp                           |  3 -
 src/test/cpp/logunit.h                             | 11 ----
 src/test/cpp/pattern/num343patternconverter.cpp    |  3 -
 src/test/cpp/util/filter.h                         |  9 ---
 97 files changed, 38 insertions(+), 742 deletions(-)

diff --git a/src/main/cpp/class.cpp b/src/main/cpp/class.cpp
index d608a4d1..c16f2cf1 100644
--- a/src/main/cpp/class.cpp
+++ b/src/main/cpp/class.cpp
@@ -15,10 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/class.h>
 #include <log4cxx/helpers/exception.h>
diff --git a/src/main/cpp/classnamepatternconverter.cpp 
b/src/main/cpp/classnamepatternconverter.cpp
index 5e2830a6..44519127 100644
--- a/src/main/cpp/classnamepatternconverter.cpp
+++ b/src/main/cpp/classnamepatternconverter.cpp
@@ -15,10 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/classnamepatternconverter.h>
 #include <log4cxx/spi/loggingevent.h>
diff --git a/src/main/cpp/colorendpatternconverter.cpp 
b/src/main/cpp/colorendpatternconverter.cpp
index 267146ce..56f39e5f 100644
--- a/src/main/cpp/colorendpatternconverter.cpp
+++ b/src/main/cpp/colorendpatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/colorendpatternconverter.h>
diff --git a/src/main/cpp/colorstartpatternconverter.cpp 
b/src/main/cpp/colorstartpatternconverter.cpp
index a86d8b4a..02a8d779 100644
--- a/src/main/cpp/colorstartpatternconverter.cpp
+++ b/src/main/cpp/colorstartpatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/colorstartpatternconverter.h>
diff --git a/src/main/cpp/datepatternconverter.cpp 
b/src/main/cpp/datepatternconverter.cpp
index e05947c9..e70aeb51 100644
--- a/src/main/cpp/datepatternconverter.cpp
+++ b/src/main/cpp/datepatternconverter.cpp
@@ -15,10 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/datepatternconverter.h>
 #include <log4cxx/spi/loggingevent.h>
diff --git a/src/main/cpp/filedatepatternconverter.cpp 
b/src/main/cpp/filedatepatternconverter.cpp
index cd036455..be6c81b2 100644
--- a/src/main/cpp/filedatepatternconverter.cpp
+++ b/src/main/cpp/filedatepatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/filedatepatternconverter.h>
diff --git a/src/main/cpp/filelocationpatternconverter.cpp 
b/src/main/cpp/filelocationpatternconverter.cpp
index 9bb471b6..0186f9dc 100644
--- a/src/main/cpp/filelocationpatternconverter.cpp
+++ b/src/main/cpp/filelocationpatternconverter.cpp
@@ -14,11 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/filelocationpatternconverter.h>
 #include <log4cxx/spi/loggingevent.h>
diff --git a/src/main/cpp/fulllocationpatternconverter.cpp 
b/src/main/cpp/fulllocationpatternconverter.cpp
index eb70a3a3..1eb74f61 100644
--- a/src/main/cpp/fulllocationpatternconverter.cpp
+++ b/src/main/cpp/fulllocationpatternconverter.cpp
@@ -15,10 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/fulllocationpatternconverter.h>
 #include <log4cxx/spi/loggingevent.h>
diff --git a/src/main/cpp/inetaddress.cpp b/src/main/cpp/inetaddress.cpp
index a4647e46..922b859c 100644
--- a/src/main/cpp/inetaddress.cpp
+++ b/src/main/cpp/inetaddress.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/inetaddress.h>
diff --git a/src/main/cpp/integerpatternconverter.cpp 
b/src/main/cpp/integerpatternconverter.cpp
index 6815dedf..b6dfb0b8 100644
--- a/src/main/cpp/integerpatternconverter.cpp
+++ b/src/main/cpp/integerpatternconverter.cpp
@@ -14,10 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/integerpatternconverter.h>
diff --git a/src/main/cpp/levelpatternconverter.cpp 
b/src/main/cpp/levelpatternconverter.cpp
index 7d4f7f0e..eaabbfeb 100644
--- a/src/main/cpp/levelpatternconverter.cpp
+++ b/src/main/cpp/levelpatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/levelpatternconverter.h>
diff --git a/src/main/cpp/linelocationpatternconverter.cpp 
b/src/main/cpp/linelocationpatternconverter.cpp
index b93ce2f5..8710c305 100644
--- a/src/main/cpp/linelocationpatternconverter.cpp
+++ b/src/main/cpp/linelocationpatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/linelocationpatternconverter.h>
diff --git a/src/main/cpp/lineseparatorpatternconverter.cpp 
b/src/main/cpp/lineseparatorpatternconverter.cpp
index a40cae96..6e1cf209 100644
--- a/src/main/cpp/lineseparatorpatternconverter.cpp
+++ b/src/main/cpp/lineseparatorpatternconverter.cpp
@@ -14,10 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/lineseparatorpatternconverter.h>
diff --git a/src/main/cpp/literalpatternconverter.cpp 
b/src/main/cpp/literalpatternconverter.cpp
index 901ca182..0e42222a 100644
--- a/src/main/cpp/literalpatternconverter.cpp
+++ b/src/main/cpp/literalpatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/literalpatternconverter.h>
diff --git a/src/main/cpp/loggerpatternconverter.cpp 
b/src/main/cpp/loggerpatternconverter.cpp
index 2fa6d575..4fbbd41e 100644
--- a/src/main/cpp/loggerpatternconverter.cpp
+++ b/src/main/cpp/loggerpatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/loggerpatternconverter.h>
diff --git a/src/main/cpp/loggingeventpatternconverter.cpp 
b/src/main/cpp/loggingeventpatternconverter.cpp
index df74b16d..7fac1829 100644
--- a/src/main/cpp/loggingeventpatternconverter.cpp
+++ b/src/main/cpp/loggingeventpatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/loggingeventpatternconverter.h>
diff --git a/src/main/cpp/logmanager.cpp b/src/main/cpp/logmanager.cpp
index 08a4903e..1d4d957e 100644
--- a/src/main/cpp/logmanager.cpp
+++ b/src/main/cpp/logmanager.cpp
@@ -15,11 +15,6 @@
  * limitations under the License.
  */
 
-
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logmanager.h>
 #include <log4cxx/defaultconfigurator.h>
 #include <log4cxx/spi/defaultrepositoryselector.h>
diff --git a/src/main/cpp/messagepatternconverter.cpp 
b/src/main/cpp/messagepatternconverter.cpp
index b30d50d2..83269d97 100644
--- a/src/main/cpp/messagepatternconverter.cpp
+++ b/src/main/cpp/messagepatternconverter.cpp
@@ -14,11 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/messagepatternconverter.h>
diff --git a/src/main/cpp/methodlocationpatternconverter.cpp 
b/src/main/cpp/methodlocationpatternconverter.cpp
index ecbb5361..10c90853 100644
--- a/src/main/cpp/methodlocationpatternconverter.cpp
+++ b/src/main/cpp/methodlocationpatternconverter.cpp
@@ -14,11 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/methodlocationpatternconverter.h>
diff --git a/src/main/cpp/multiprocessrollingfileappender.cpp 
b/src/main/cpp/multiprocessrollingfileappender.cpp
index 95a6140f..f54e8cb6 100644
--- a/src/main/cpp/multiprocessrollingfileappender.cpp
+++ b/src/main/cpp/multiprocessrollingfileappender.cpp
@@ -15,11 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <apr_portable.h>
 #include <apr_file_io.h>
 #include <apr_atomic.h>
diff --git a/src/main/cpp/namepatternconverter.cpp 
b/src/main/cpp/namepatternconverter.cpp
index ebc3d24d..9efd1da6 100644
--- a/src/main/cpp/namepatternconverter.cpp
+++ b/src/main/cpp/namepatternconverter.cpp
@@ -15,10 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/namepatternconverter.h>
 #include <log4cxx/pattern/nameabbreviator.h>
diff --git a/src/main/cpp/ndc.cpp b/src/main/cpp/ndc.cpp
index e2194ab5..a98e533c 100644
--- a/src/main/cpp/ndc.cpp
+++ b/src/main/cpp/ndc.cpp
@@ -15,11 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/ndc.h>
 #include <log4cxx/helpers/transcoder.h>
 #include <log4cxx/helpers/threadspecificdata.h>
diff --git a/src/main/cpp/ndcpatternconverter.cpp 
b/src/main/cpp/ndcpatternconverter.cpp
index 59e7f4b5..64975612 100644
--- a/src/main/cpp/ndcpatternconverter.cpp
+++ b/src/main/cpp/ndcpatternconverter.cpp
@@ -15,12 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/ndcpatternconverter.h>
 #include <log4cxx/spi/loggingevent.h>
diff --git a/src/main/cpp/nteventlogappender.cpp 
b/src/main/cpp/nteventlogappender.cpp
index 91aee586..91519805 100644
--- a/src/main/cpp/nteventlogappender.cpp
+++ b/src/main/cpp/nteventlogappender.cpp
@@ -267,9 +267,9 @@ void NTEventLogAppender::addRegistryInfo()
                {
                        modpath[modlen] = 0;
                        RegSetValueExW(hkey, L"EventMessageFile", 0, REG_SZ,
-                               (LPBYTE) modpath, wcslen(modpath) * 
sizeof(wchar_t));
+                               (LPBYTE) modpath, (DWORD)(wcslen(modpath) * 
sizeof(wchar_t)));
                        RegSetValueExW(hkey, L"CategoryMessageFile", 0, REG_SZ,
-                               (LPBYTE) modpath, wcslen(modpath) * 
sizeof(wchar_t));
+                               (LPBYTE) modpath, (DWORD)(wcslen(modpath) * 
sizeof(wchar_t)));
                        DWORD typesSupported = 7;
                        DWORD categoryCount = 6;
                        RegSetValueExW(hkey, L"TypesSupported", 0, REG_DWORD,
diff --git a/src/main/cpp/objectoutputstream.cpp 
b/src/main/cpp/objectoutputstream.cpp
index ab9a85b1..0fee6e02 100644
--- a/src/main/cpp/objectoutputstream.cpp
+++ b/src/main/cpp/objectoutputstream.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/objectoutputstream.h>
diff --git a/src/main/cpp/patternconverter.cpp 
b/src/main/cpp/patternconverter.cpp
index 6e0e0666..d0c186a9 100644
--- a/src/main/cpp/patternconverter.cpp
+++ b/src/main/cpp/patternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/patternconverter.h>
diff --git a/src/main/cpp/patternlayout.cpp b/src/main/cpp/patternlayout.cpp
index 1a3e9650..4d119f80 100644
--- a/src/main/cpp/patternlayout.cpp
+++ b/src/main/cpp/patternlayout.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/patternlayout.h>
diff --git a/src/main/cpp/propertiespatternconverter.cpp 
b/src/main/cpp/propertiespatternconverter.cpp
index c90fde2a..51e41e77 100644
--- a/src/main/cpp/propertiespatternconverter.cpp
+++ b/src/main/cpp/propertiespatternconverter.cpp
@@ -15,10 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/propertiespatternconverter.h>
 #include <log4cxx/spi/loggingevent.h>
diff --git a/src/main/cpp/relativetimepatternconverter.cpp 
b/src/main/cpp/relativetimepatternconverter.cpp
index 27420081..e3726b62 100644
--- a/src/main/cpp/relativetimepatternconverter.cpp
+++ b/src/main/cpp/relativetimepatternconverter.cpp
@@ -14,10 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/relativetimepatternconverter.h>
diff --git a/src/main/cpp/rollingfileappender.cpp 
b/src/main/cpp/rollingfileappender.cpp
index a9c776a9..a6bc4e0e 100644
--- a/src/main/cpp/rollingfileappender.cpp
+++ b/src/main/cpp/rollingfileappender.cpp
@@ -15,10 +15,6 @@
  * limitations under the License.
  */
 
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/rolling/rollingfileappender.h>
 #include <log4cxx/helpers/loglog.h>
 #include <log4cxx/rolling/rolloverdescription.h>
diff --git a/src/main/cpp/rollingpolicybase.cpp 
b/src/main/cpp/rollingpolicybase.cpp
index 2d851ee1..7af81669 100644
--- a/src/main/cpp/rollingpolicybase.cpp
+++ b/src/main/cpp/rollingpolicybase.cpp
@@ -14,10 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/rolling/rollingpolicybase.h>
diff --git a/src/main/cpp/shortfilelocationpatternconverter.cpp 
b/src/main/cpp/shortfilelocationpatternconverter.cpp
index 2de8b6ef..958fef43 100644
--- a/src/main/cpp/shortfilelocationpatternconverter.cpp
+++ b/src/main/cpp/shortfilelocationpatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-#pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/shortfilelocationpatternconverter.h>
diff --git a/src/main/cpp/socketappenderskeleton.cpp 
b/src/main/cpp/socketappenderskeleton.cpp
index 67e607c3..3542939a 100644
--- a/src/main/cpp/socketappenderskeleton.cpp
+++ b/src/main/cpp/socketappenderskeleton.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #define __STDC_CONSTANT_MACROS
 #include <log4cxx/net/socketappenderskeleton.h>
diff --git a/src/main/cpp/sockethubappender.cpp 
b/src/main/cpp/sockethubappender.cpp
index 62e5ea75..676c1cb4 100644
--- a/src/main/cpp/sockethubappender.cpp
+++ b/src/main/cpp/sockethubappender.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/net/sockethubappender.h>
 
diff --git a/src/main/cpp/syslogwriter.cpp b/src/main/cpp/syslogwriter.cpp
index 5ab1ba5e..f348bb8e 100644
--- a/src/main/cpp/syslogwriter.cpp
+++ b/src/main/cpp/syslogwriter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/syslogwriter.h>
@@ -72,7 +69,7 @@ void SyslogWriter::write(const LogString& source)
                LOG4CXX_ENCODE_CHAR(data, source);
 
                auto packet = std::make_shared<DatagramPacket>(
-                               (void*) data.data(), data.length(),
+                               (void*) data.data(), (int)data.length(),
                                m_priv->address, m_priv->syslogHostPort);
 
                m_priv->ds->send(packet);
diff --git a/src/main/cpp/threadpatternconverter.cpp 
b/src/main/cpp/threadpatternconverter.cpp
index 54532154..f75e4e46 100644
--- a/src/main/cpp/threadpatternconverter.cpp
+++ b/src/main/cpp/threadpatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/threadpatternconverter.h>
diff --git a/src/main/cpp/threadusernamepatternconverter.cpp 
b/src/main/cpp/threadusernamepatternconverter.cpp
index cadba741..e2887af0 100644
--- a/src/main/cpp/threadusernamepatternconverter.cpp
+++ b/src/main/cpp/threadusernamepatternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/threadusernamepatternconverter.h>
diff --git a/src/main/cpp/throwableinformationpatternconverter.cpp 
b/src/main/cpp/throwableinformationpatternconverter.cpp
index 8a06c3a1..33a708ff 100644
--- a/src/main/cpp/throwableinformationpatternconverter.cpp
+++ b/src/main/cpp/throwableinformationpatternconverter.cpp
@@ -14,11 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 
 #include <log4cxx/logstring.h>
 #include <log4cxx/pattern/throwableinformationpatternconverter.h>
diff --git a/src/main/cpp/timebasedrollingpolicy.cpp 
b/src/main/cpp/timebasedrollingpolicy.cpp
index bb78514a..ed63f21b 100644
--- a/src/main/cpp/timebasedrollingpolicy.cpp
+++ b/src/main/cpp/timebasedrollingpolicy.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/log4cxx.h>
 #include <log4cxx/logstring.h>
diff --git a/src/main/cpp/timezone.cpp b/src/main/cpp/timezone.cpp
index b7c7fa84..740b2fac 100644
--- a/src/main/cpp/timezone.cpp
+++ b/src/main/cpp/timezone.cpp
@@ -14,10 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 
 #define __STDC_CONSTANT_MACROS
 #include <log4cxx/logstring.h>
diff --git a/src/main/include/log4cxx/appender.h 
b/src/main/include/log4cxx/appender.h
index 6402c52c..556d6b7b 100644
--- a/src/main/include/log4cxx/appender.h
+++ b/src/main/include/log4cxx/appender.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_APPENDER_H
 #define _LOG4CXX_APPENDER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/spi/optionhandler.h>
 #include <log4cxx/helpers/object.h>
 #include <vector>
@@ -140,8 +134,4 @@ LOG4CXX_LIST_DEF(AppenderList, AppenderPtr);
 
 }
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif //_LOG4CXX_APPENDER_H
diff --git a/src/main/include/log4cxx/asyncappender.h 
b/src/main/include/log4cxx/asyncappender.h
index c2404b84..9bba926f 100644
--- a/src/main/include/log4cxx/asyncappender.h
+++ b/src/main/include/log4cxx/asyncappender.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_ASYNC_APPENDER_H
 #define _LOG4CXX_ASYNC_APPENDER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/appenderskeleton.h>
 #include <log4cxx/helpers/appenderattachableimpl.h>
 #include <deque>
@@ -202,10 +196,5 @@ class LOG4CXX_EXPORT AsyncAppender :
 LOG4CXX_PTR_DEF(AsyncAppender);
 }  //  namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
-
 #endif//  _LOG4CXX_ASYNC_APPENDER_H
 
diff --git a/src/main/include/log4cxx/config_msvc.h.in 
b/src/main/include/log4cxx/config_msvc.h.in
deleted file mode 100644
index a1c25acd..00000000
--- a/src/main/include/log4cxx/config_msvc.h.in
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/* Name of package */
-#define PACKAGE "log4cxx"
-
-/* Version number of package */
-#define VERSION "@VERSION@"
-
-/* Define to 1 if you have the `ftime' function. */
-#define LOG4CXX_HAVE_FTIME 1
-
-/* ODBC support through Microsoft ODBC. */
-#define LOG4CXX_HAVE_MS_ODBC 1
-
-/* thread support through Microsoft threads. */
-#define LOG4CXX_HAVE_MS_THREAD 1
-
-/* ODBC support */
-#define LOG4CXX_HAVE_ODBC 1
-
-/* thread support */
-#define LOG4CXX_HAVE_THREAD 1
-
-typedef __int64 int64_t;
-
-#if defined(WIN32) || defined(_WIN32)
-#pragma warning(disable : 4250 4251 4786 4290)
-#endif
-
-#ifdef LOG4CXX_STATIC
-#define LOG4CXX_EXPORT
-// cf. file msvc/static/static.cpp
-#pragma comment(linker, "/include:?ForceSymbolReferences@@YAXXZ")
-#else // DLL
-#ifdef LOG4CXX
-       #define LOG4CXX_EXPORT __declspec(dllexport)
-#else
-       #define LOG4CXX_EXPORT __declspec(dllimport)
-#endif
-#endif
-
-#if !defined(LOG4CXX_HAVE_OLD_WIN32_INTERLOCKS)
-#if defined(_MSC_VER)
-#if _MSC_VER <= 1200
-#define LOG4CXX_HAVE_OLD_WIN32_INTERLOCKS 1
-#else
-#define LOG4CXX_HAVE_OLD_WIN32_INTERLOCKS 0
-#endif
-#else
-#define LOG4CXX_HAVE_OLD_WIN32_INTERLOCKS 0
-#endif
-#endif
-
-#define _WIN32_WINNT 0x0400
-
-#include <tchar.h>
diff --git a/src/main/include/log4cxx/consoleappender.h 
b/src/main/include/log4cxx/consoleappender.h
index aab1dc33..54a7178b 100644
--- a/src/main/include/log4cxx/consoleappender.h
+++ b/src/main/include/log4cxx/consoleappender.h
@@ -20,11 +20,6 @@
 
 #include <log4cxx/writerappender.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 
@@ -79,9 +74,5 @@ class LOG4CXX_EXPORT ConsoleAppender : public WriterAppender
 LOG4CXX_PTR_DEF(ConsoleAppender);
 }  //namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_CONSOLE_APPENDER_H
 
diff --git a/src/main/include/log4cxx/db/odbcappender.h 
b/src/main/include/log4cxx/db/odbcappender.h
index b4104b97..363f6d56 100644
--- a/src/main/include/log4cxx/db/odbcappender.h
+++ b/src/main/include/log4cxx/db/odbcappender.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_DB_ODBC_APPENDER_H
 #define _LOG4CXX_DB_ODBC_APPENDER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/log4cxx.h>
 
 #include <log4cxx/helpers/exception.h>
@@ -236,8 +230,4 @@ LOG4CXX_PTR_DEF(ODBCAppender);
 } // namespace db
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif // _LOG4CXX_DB_ODBC_APPENDER_H
diff --git a/src/main/include/log4cxx/file.h b/src/main/include/log4cxx/file.h
index 9e6fa066..4d4ead8c 100644
--- a/src/main/include/log4cxx/file.h
+++ b/src/main/include/log4cxx/file.h
@@ -21,11 +21,6 @@
 #include <log4cxx/logger.h>
 #include <log4cxx/logstring.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 extern "C" {
        struct apr_file_t;
        struct apr_finfo_t;
@@ -182,17 +177,12 @@ class LOG4CXX_EXPORT File
                bool mkdirs(log4cxx::helpers::Pool& p) const;
 
        private:
-               LogString path;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, path)
                static char* convertBackSlashes(char*);
                char* getPath(log4cxx::helpers::Pool& p) const;
 };
 } // namespace log4cxx
 
-
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #define LOG4CXX_FILE(name) log4cxx::File(name)
 
 #endif // _LOG4CXX_FILE_H
diff --git a/src/main/include/log4cxx/filter/andfilter.h 
b/src/main/include/log4cxx/filter/andfilter.h
index 2d4a30d9..2d753004 100644
--- a/src/main/include/log4cxx/filter/andfilter.h
+++ b/src/main/include/log4cxx/filter/andfilter.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_FILTER_ANDFILTER_H
 #define _LOG4CXX_FILTER_ANDFILTER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/spi/filter.h>
 #include <memory>
 
@@ -104,8 +98,4 @@ LOG4CXX_PTR_DEF(AndFilter);
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif
diff --git a/src/main/include/log4cxx/filter/denyallfilter.h 
b/src/main/include/log4cxx/filter/denyallfilter.h
index eb6746c0..2db53f89 100644
--- a/src/main/include/log4cxx/filter/denyallfilter.h
+++ b/src/main/include/log4cxx/filter/denyallfilter.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_FILTER_DENY_ALL_FILTER_H
 #define _LOG4CXX_FILTER_DENY_ALL_FILTER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/spi/filter.h>
 
 namespace log4cxx
@@ -68,9 +62,4 @@ LOG4CXX_PTR_DEF(DenyAllFilter);
 }  // namespace filter
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
-
 #endif // _LOG4CXX_FILTER_DENY_ALL_FILTER_H
diff --git a/src/main/include/log4cxx/filter/expressionfilter.h 
b/src/main/include/log4cxx/filter/expressionfilter.h
index 8eaf84e0..77b5d107 100644
--- a/src/main/include/log4cxx/filter/expressionfilter.h
+++ b/src/main/include/log4cxx/filter/expressionfilter.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_FILTER_EXPRESSIONFILTER_H
 #define _LOG4CXX_FILTER_EXPRESSIONFILTER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/spi/filter.h>
 
 namespace log4cxx
@@ -86,8 +80,8 @@ class LOG4CXX_EXPORT ExpressionFilter: public 
log4cxx::spi::Filter
        private:
                bool acceptOnMatch;
                bool convertInFixToPostFix;
-               LogString expression;
-               log4cxx::rule::RulePtr expressionRule;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, expression)
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(rule::RulePtr, expressionRule)
                ExpressionFilter(const ExpressionFilter&);
                ExpressionFilter& operator=(const ExpressionFilter&);
 
@@ -122,9 +116,5 @@ class LOG4CXX_EXPORT ExpressionFilter: public 
log4cxx::spi::Filter
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 
 #endif
diff --git a/src/main/include/log4cxx/filter/levelmatchfilter.h 
b/src/main/include/log4cxx/filter/levelmatchfilter.h
index 6240bc4f..8776af96 100644
--- a/src/main/include/log4cxx/filter/levelmatchfilter.h
+++ b/src/main/include/log4cxx/filter/levelmatchfilter.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_FILTER_LEVEL_MATCH_FILTER_H
 #define _LOG4CXX_FILTER_LEVEL_MATCH_FILTER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/spi/filter.h>
 #include <log4cxx/level.h>
 
@@ -92,8 +86,4 @@ LOG4CXX_PTR_DEF(LevelMatchFilter);
 }  // namespace filter
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif // _LOG4CXX_FILTER_LEVEL_MATCH_FILTER_H
diff --git a/src/main/include/log4cxx/filter/locationinfofilter.h 
b/src/main/include/log4cxx/filter/locationinfofilter.h
index f4e2953e..a6a574fe 100644
--- a/src/main/include/log4cxx/filter/locationinfofilter.h
+++ b/src/main/include/log4cxx/filter/locationinfofilter.h
@@ -46,8 +46,8 @@ namespace filter
 class LOG4CXX_EXPORT LocationInfoFilter: public log4cxx::spi::Filter
 {
                bool convertInFixToPostFix;
-               LogString expression;
-               log4cxx::rule::RulePtr expressionRule;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, expression)
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(rule::RulePtr, expressionRule)
                //HACK: Category is the last of the internal layers - pass this 
in as the class name
                //in order for parsing to work correctly
                LogString className;
diff --git a/src/main/include/log4cxx/filter/loggermatchfilter.h 
b/src/main/include/log4cxx/filter/loggermatchfilter.h
index 7b7c3c20..679f639e 100644
--- a/src/main/include/log4cxx/filter/loggermatchfilter.h
+++ b/src/main/include/log4cxx/filter/loggermatchfilter.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_FILTER_LOGGER_MATCH_FILTER_H
 #define _LOG4CXX_FILTER_LOGGER_MATCH_FILTER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/spi/filter.h>
 #include <log4cxx/level.h>
 
@@ -94,8 +88,4 @@ LOG4CXX_PTR_DEF(LoggerMatchFilter);
 }  // namespace filter
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif // _LOG4CXX_FILTER_LOGGER_MATCH_FILTER_H
diff --git a/src/main/include/log4cxx/filter/mapfilter.h 
b/src/main/include/log4cxx/filter/mapfilter.h
index c6cf5c67..192283d1 100644
--- a/src/main/include/log4cxx/filter/mapfilter.h
+++ b/src/main/include/log4cxx/filter/mapfilter.h
@@ -19,11 +19,6 @@
 
 #include <log4cxx/spi/filter.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace filter
@@ -86,8 +81,5 @@ LOG4CXX_PTR_DEF(MapFilter);
 } // namespace filter
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
 
 #endif // _LOG4CXX_FILTER_MAPFILTER_H
diff --git a/src/main/include/log4cxx/filter/propertyfilter.h 
b/src/main/include/log4cxx/filter/propertyfilter.h
index a360021d..d6d1691f 100644
--- a/src/main/include/log4cxx/filter/propertyfilter.h
+++ b/src/main/include/log4cxx/filter/propertyfilter.h
@@ -19,12 +19,6 @@
 #ifndef _LOG4CXX_FILTER_PROPERTYFILTER_H
 #define _LOG4CXX_FILTER_PROPERTYFILTER_H
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/spi/filter.h>
 #include <map>
 
@@ -74,8 +68,4 @@ class LOG4CXX_EXPORT PropertyFilter : public 
log4cxx::spi::Filter
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif
diff --git a/src/main/include/log4cxx/filter/stringmatchfilter.h 
b/src/main/include/log4cxx/filter/stringmatchfilter.h
index c4d5763a..5ac5b969 100644
--- a/src/main/include/log4cxx/filter/stringmatchfilter.h
+++ b/src/main/include/log4cxx/filter/stringmatchfilter.h
@@ -20,11 +20,6 @@
 
 #include <log4cxx/spi/filter.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace filter
@@ -89,8 +84,5 @@ LOG4CXX_PTR_DEF(StringMatchFilter);
 }  // namespace filter
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
 
 #endif // _LOG4CXX_FILTER_STRING_MATCH_FILTER_H
diff --git a/src/main/include/log4cxx/helpers/class.h 
b/src/main/include/log4cxx/helpers/class.h
index 87925a78..fb3ea65c 100644
--- a/src/main/include/log4cxx/helpers/class.h
+++ b/src/main/include/log4cxx/helpers/class.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_HELPERS_CLASS_H
 #define _LOG4CXX_HELPERS_CLASS_H
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/logstring.h>
 #include <map>
 
@@ -57,9 +51,4 @@ class LOG4CXX_EXPORT Class
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
-
 #endif //_LOG4CXX_HELPERS_CLASS_H
diff --git a/src/main/include/log4cxx/helpers/exception.h 
b/src/main/include/log4cxx/helpers/exception.h
index 03499275..be2c5aa2 100644
--- a/src/main/include/log4cxx/helpers/exception.h
+++ b/src/main/include/log4cxx/helpers/exception.h
@@ -24,7 +24,7 @@
 
 #ifdef _MSC_VER
        #pragma warning ( push )
-       #pragma warning (disable : 4251 4275) // ::std::exception needs to have 
dll-interface
+       #pragma warning (disable : 4275) // ::std::exception needs to have 
dll-interface
 #endif
 
 namespace log4cxx
diff --git a/src/main/include/log4cxx/helpers/inetaddress.h 
b/src/main/include/log4cxx/helpers/inetaddress.h
index 6205a1a6..a2397fab 100644
--- a/src/main/include/log4cxx/helpers/inetaddress.h
+++ b/src/main/include/log4cxx/helpers/inetaddress.h
@@ -18,13 +18,6 @@
 #ifndef _LOG4CXX_HELPER_INETADDRESS_H
 #define _LOG4CXX_HELPER_INETADDRESS_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
-
 #include <log4cxx/helpers/object.h>
 #include <log4cxx/logstring.h>
 #include <vector>
@@ -34,7 +27,7 @@ namespace log4cxx
 {
 namespace helpers
 {
-class LOG4CXX_EXPORT UnknownHostException : public Exception
+class UnknownHostException : public Exception
 {
        public:
                UnknownHostException(const LogString& msg);
@@ -88,18 +81,12 @@ class LOG4CXX_EXPORT InetAddress : public Object
                LogString toString() const;
 
        private:
-               LogString ipAddrString;
-
-               LogString hostNameString;
-
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, ipAddrString)
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, hostNameString)
 }; // class InetAddress
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 
 #endif // _LOG4CXX_HELPER_INETADDRESS_H
 
diff --git a/src/main/include/log4cxx/helpers/messagebuffer.h 
b/src/main/include/log4cxx/helpers/messagebuffer.h
index 285bd5d4..cb85102c 100644
--- a/src/main/include/log4cxx/helpers/messagebuffer.h
+++ b/src/main/include/log4cxx/helpers/messagebuffer.h
@@ -22,11 +22,6 @@
 #include <log4cxx/logstring.h>
 #include <sstream>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 4275 )
-#endif
-
 namespace log4cxx
 {
 
@@ -806,9 +801,5 @@ typedef CharMessageBuffer LogCharMessageBuffer;
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif
 
diff --git a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h 
b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h
index 0aa74b53..9d791bab 100644
--- a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h
+++ b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h
@@ -21,11 +21,6 @@
 #include <log4cxx/spi/errorhandler.h>
 #include <log4cxx/helpers/object.h>
 
-#ifdef _MSC_VER
-       #pragma warning ( push )
-       #pragma warning (disable : 4251) // ::std::exception needs to have 
dll-interface
-#endif
-
 namespace log4cxx
 {
 namespace helpers
@@ -45,8 +40,8 @@ class LOG4CXX_EXPORT OnlyOnceErrorHandler :
        public virtual Object
 {
        private:
-               LogString WARN_PREFIX;
-               LogString ERROR_PREFIX;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, WARN_PREFIX)
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, ERROR_PREFIX)
                mutable bool firstTime;
 
        public:
@@ -102,9 +97,5 @@ class LOG4CXX_EXPORT OnlyOnceErrorHandler :
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_HELPERS_ONLY_ONCE_ERROR_HANDLER_H
 
diff --git a/src/main/include/log4cxx/helpers/properties.h 
b/src/main/include/log4cxx/helpers/properties.h
index 4ca5234a..3202eaa8 100644
--- a/src/main/include/log4cxx/helpers/properties.h
+++ b/src/main/include/log4cxx/helpers/properties.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_HELPER_PROPERTIES_H
 #define _LOG4CXX_HELPER_PROPERTIES_H
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/object.h>
 #include <log4cxx/helpers/inputstream.h>
@@ -177,9 +171,5 @@ class LOG4CXX_EXPORT Properties
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 
 #endif //_LOG4CXX_HELPER_PROPERTIES_H
diff --git a/src/main/include/log4cxx/helpers/resourcebundle.h 
b/src/main/include/log4cxx/helpers/resourcebundle.h
index 81fa0ff9..7ea2813e 100644
--- a/src/main/include/log4cxx/helpers/resourcebundle.h
+++ b/src/main/include/log4cxx/helpers/resourcebundle.h
@@ -81,15 +81,8 @@ class LOG4CXX_EXPORT ResourceBundle : public Object
                The parent bundle is searched by #getString when this bundle 
does
                not contain a particular resource.
                */
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(ResourceBundlePtr, parent)
 
-#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/simpledateformat.h 
b/src/main/include/log4cxx/helpers/simpledateformat.h
index 4f401d92..1a7e4035 100644
--- a/src/main/include/log4cxx/helpers/simpledateformat.h
+++ b/src/main/include/log4cxx/helpers/simpledateformat.h
@@ -18,13 +18,6 @@
 #ifndef _LOG4CXX_HELPERS_SIMPLE_DATE_FORMAT_H
 #define _LOG4CXX_HELPERS_SIMPLE_DATE_FORMAT_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
-
 #include <log4cxx/helpers/dateformat.h>
 #include <vector>
 #include <time.h>
@@ -76,12 +69,12 @@ class LOG4CXX_EXPORT SimpleDateFormat : public DateFormat
                /**
                 * Time zone.
                 */
-               TimeZonePtr timeZone;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(TimeZonePtr, timeZone)
 
                /**
                 * List of tokens.
                 */
-               PatternTokenList pattern;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(PatternTokenList, pattern)
 
                static void addToken(const logchar spec, const int repeat, 
const std::locale* locale, PatternTokenList& pattern);
                static void parsePattern(const LogString& spec, const 
std::locale* locale, PatternTokenList& pattern);
@@ -91,10 +84,4 @@ class LOG4CXX_EXPORT SimpleDateFormat : public 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/strftimedateformat.h 
b/src/main/include/log4cxx/helpers/strftimedateformat.h
index d548ded0..91b8dc94 100644
--- a/src/main/include/log4cxx/helpers/strftimedateformat.h
+++ b/src/main/include/log4cxx/helpers/strftimedateformat.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 helpers
@@ -62,16 +57,12 @@ class LOG4CXX_EXPORT StrftimeDateFormat : public DateFormat
                /**
                *    Time zone.
                */
-               TimeZonePtr timeZone;
-               std::string pattern;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(TimeZonePtr, timeZone)
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(std::string, pattern)
 };
 
 
 }  // namespace helpers
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif // _LOG4CXX_HELPERS_STRFTIME_DATE_FORMAT_H
diff --git a/src/main/include/log4cxx/helpers/timezone.h 
b/src/main/include/log4cxx/helpers/timezone.h
index cf35e8cf..7bde5fe2 100644
--- a/src/main/include/log4cxx/helpers/timezone.h
+++ b/src/main/include/log4cxx/helpers/timezone.h
@@ -21,11 +21,6 @@
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/object.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 struct apr_time_exp_t;
 
 namespace log4cxx
@@ -65,15 +60,11 @@ class LOG4CXX_EXPORT TimeZone : public helpers::Object
                TimeZone(const LogString& ID);
                virtual ~TimeZone();
 
-               const LogString id;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, id)
 };
 
 
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_HELPERS_TIMEZONE_H
diff --git a/src/main/include/log4cxx/helpers/transcoder.h 
b/src/main/include/log4cxx/helpers/transcoder.h
index 83be52ef..682b4db5 100644
--- a/src/main/include/log4cxx/helpers/transcoder.h
+++ b/src/main/include/log4cxx/helpers/transcoder.h
@@ -18,11 +18,6 @@
 #ifndef _LOG4CXX_HELPERS_TRANSCODER_H
 #define _LOG4CXX_HELPERS_TRANSCODER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 
 
@@ -252,8 +247,4 @@ class LOG4CXX_EXPORT Transcoder
 
 #endif
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_HELPERS_TRANSCODER_H
diff --git a/src/main/include/log4cxx/helpers/xml.h 
b/src/main/include/log4cxx/helpers/xml.h
index 925f5001..5c05cfb2 100644
--- a/src/main/include/log4cxx/helpers/xml.h
+++ b/src/main/include/log4cxx/helpers/xml.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_HELPERS_XML_H
 #define _LOG4CXX_HELPERS_XML_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/object.h>
 #include <log4cxx/helpers/exception.h>
@@ -121,10 +115,5 @@ LOG4CXX_PTR_DEF(XMLDOMNodeList);
 }  // namespace helpers
 } // namespace log4cxx
 
-
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif // _LOG4CXX_HELPERS_XML_H
 
diff --git a/src/main/include/log4cxx/jsonlayout.h 
b/src/main/include/log4cxx/jsonlayout.h
index 016fe9d0..6e06f9fa 100644
--- a/src/main/include/log4cxx/jsonlayout.h
+++ b/src/main/include/log4cxx/jsonlayout.h
@@ -22,11 +22,6 @@
 #include <log4cxx/helpers/iso8601dateformat.h>
 #include <log4cxx/spi/loggingevent.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 
 namespace log4cxx
 {
@@ -44,8 +39,8 @@ class LOG4CXX_EXPORT JSONLayout : public Layout
 
        protected:
 
-               LogString ppIndentL1;
-               LogString ppIndentL2;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, ppIndentL1)
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, ppIndentL2)
 
                void appendQuotedEscapedString(LogString& buf, const LogString& 
input) const;
                void appendSerializedMDC(LogString& buf,
@@ -139,8 +134,4 @@ class LOG4CXX_EXPORT JSONLayout : public Layout
 LOG4CXX_PTR_DEF(JSONLayout);
 }  // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif // _LOG4CXX_JSON_LAYOUT_H
diff --git a/src/main/include/log4cxx/layout.h 
b/src/main/include/log4cxx/layout.h
index 51de0d31..3922e48a 100644
--- a/src/main/include/log4cxx/layout.h
+++ b/src/main/include/log4cxx/layout.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_LAYOUT_H
 #define _LOG4CXX_LAYOUT_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/helpers/object.h>
 #include <log4cxx/spi/optionhandler.h>
 #include <log4cxx/spi/loggingevent.h>
@@ -86,8 +80,4 @@ class LOG4CXX_EXPORT Layout :
 LOG4CXX_PTR_DEF(Layout);
 }
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif // _LOG4CXX_LAYOUT_H
diff --git a/src/main/include/log4cxx/level.h b/src/main/include/log4cxx/level.h
index b89a6047..8644b81b 100644
--- a/src/main/include/log4cxx/level.h
+++ b/src/main/include/log4cxx/level.h
@@ -24,11 +24,6 @@
 #include <log4cxx/helpers/object.h>
 #include <mutex>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 /**
@@ -278,8 +273,9 @@ class LOG4CXX_EXPORT Level : public helpers::Object
                        return level;
                }
 
+       private:
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, name)
                int level;
-               LogString name;
                int syslogEquivalent;
                Level(const Level&);
                Level& operator=(const Level&);
@@ -304,8 +300,4 @@ class LOG4CXX_EXPORT Level : public helpers::Object
 #define IMPLEMENT_LOG4CXX_LEVEL(level) \
        IMPLEMENT_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(level, Class##level)
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_LEVEL_H
diff --git a/src/main/include/log4cxx/log4cxx.h.in 
b/src/main/include/log4cxx/log4cxx.h.in
index 88470937..12ed0dbc 100644
--- a/src/main/include/log4cxx/log4cxx.h.in
+++ b/src/main/include/log4cxx/log4cxx.h.in
@@ -74,6 +74,12 @@ __pragma( warning( disable : 4251 ) ) \
     struct T; LOG4CXX_PRIVATE_PTR(T) V; \
 __pragma( warning( pop ) )
 
+#define LOG4CXX_DECLARE_PRIVATE_MEMBER(T, V) \
+__pragma( warning( push ) ) \
+__pragma( warning( disable : 4251 ) ) \
+    T V; \
+__pragma( warning( pop ) )
+
 //  definitions used when using static library
 #if defined(LOG4CXX_STATIC)
 #define LOG4CXX_EXPORT
@@ -88,6 +94,7 @@ __pragma( warning( pop ) )
 #else
 #define LOG4CXX_EXPORT
 #define LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(T, V) struct T; 
LOG4CXX_PRIVATE_PTR(T) V;
+#define LOG4CXX_DECLARE_PRIVATE_MEMBER(T, V) T V;
 #define LOG4CXX_INSTANTIATE_EXPORTED_PTR(T)
 #endif /* WIN32 */
 
diff --git a/src/main/include/log4cxx/logmanager.h 
b/src/main/include/log4cxx/logmanager.h
index 109ff98c..d2aa2854 100644
--- a/src/main/include/log4cxx/logmanager.h
+++ b/src/main/include/log4cxx/logmanager.h
@@ -18,11 +18,6 @@
 #ifndef _LOG4CXX_LOG_MANAGER_H
 #define _LOG4CXX_LOG_MANAGER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 #include <vector>
 #include <log4cxx/spi/repositoryselector.h>
@@ -224,9 +219,5 @@ class LOG4CXX_EXPORT LogManager
 }; // class LogManager
 }  // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 
 #endif //_LOG4CXX_LOG_MANAGER_H
diff --git a/src/main/include/log4cxx/logstring.h 
b/src/main/include/log4cxx/logstring.h
index f854fc3c..eca33fe9 100644
--- a/src/main/include/log4cxx/logstring.h
+++ b/src/main/include/log4cxx/logstring.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_STRING_H
 #define _LOG4CXX_STRING_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <string>
 #include <log4cxx/log4cxx.h>
 
@@ -65,10 +59,8 @@ namespace log4cxx
 
 typedef std::basic_string<logchar> LogString;
 
-
 }
 
-
 #if !defined(LOG4CXX_EOL)
        #if defined(_WIN32)
                #define LOG4CXX_EOL LOG4CXX_STR("\x0D\x0A")
@@ -82,8 +74,4 @@ typedef std::basic_string<logchar> LogString;
        #include <log4cxx/helpers/transcoder.h>
 #endif
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_STRING_H
diff --git a/src/main/include/log4cxx/mdc.h b/src/main/include/log4cxx/mdc.h
index 49214cf1..01d44d55 100644
--- a/src/main/include/log4cxx/mdc.h
+++ b/src/main/include/log4cxx/mdc.h
@@ -22,11 +22,6 @@
 #include <log4cxx/logstring.h>
 #include <map>
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 namespace log4cxx
 {
 
@@ -224,13 +219,9 @@ class LOG4CXX_EXPORT MDC
        private:
                MDC(const MDC&);
                MDC& operator=(const MDC&);
-               LogString key;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, key)
 }; // class MDC;
 }  // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 
 #endif // _LOG4CXX_MDC_H
diff --git a/src/main/include/log4cxx/ndc.h b/src/main/include/log4cxx/ndc.h
index 704e0a73..c2642cd8 100644
--- a/src/main/include/log4cxx/ndc.h
+++ b/src/main/include/log4cxx/ndc.h
@@ -22,11 +22,6 @@
 #include <log4cxx/logstring.h>
 #include <stack>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 namespace log4cxx
 {
 
@@ -346,9 +341,4 @@ class LOG4CXX_EXPORT NDC
 }; // class NDC;
 }  // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
-
 #endif // _LOG4CXX_NDC_H
diff --git a/src/main/include/log4cxx/net/smtpappender.h 
b/src/main/include/log4cxx/net/smtpappender.h
index 445bc8db..ae878384 100644
--- a/src/main/include/log4cxx/net/smtpappender.h
+++ b/src/main/include/log4cxx/net/smtpappender.h
@@ -23,11 +23,6 @@
 #include <log4cxx/helpers/cyclicbuffer.h>
 #include <log4cxx/spi/triggeringeventevaluator.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace net
@@ -270,8 +265,4 @@ LOG4CXX_PTR_DEF(SMTPAppender);
 }  // namespace net
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif // _LOG4CXX_NET_SMTP_H
diff --git a/src/main/include/log4cxx/net/sockethubappender.h 
b/src/main/include/log4cxx/net/sockethubappender.h
index b79ab387..38c95a5d 100644
--- a/src/main/include/log4cxx/net/sockethubappender.h
+++ b/src/main/include/log4cxx/net/sockethubappender.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_NET_SOCKET_HUB_APPENDER_H
 #define _LOG4CXX_NET_SOCKET_HUB_APPENDER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/appenderskeleton.h>
 #include <vector>
 #include <thread>
@@ -186,9 +180,4 @@ LOG4CXX_PTR_DEF(SocketHubAppender);
 }  // namespace net
 } // namespace log4cxx
 
-
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif // _LOG4CXX_NET_SOCKET_HUB_APPENDER_H
diff --git a/src/main/include/log4cxx/net/syslogappender.h 
b/src/main/include/log4cxx/net/syslogappender.h
index 1dff8309..db8acd3b 100644
--- a/src/main/include/log4cxx/net/syslogappender.h
+++ b/src/main/include/log4cxx/net/syslogappender.h
@@ -21,11 +21,6 @@
 #include <log4cxx/appenderskeleton.h>
 #include <log4cxx/helpers/syslogwriter.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace net
@@ -152,9 +147,5 @@ LOG4CXX_PTR_DEF(SyslogAppender);
 } // namespace net
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif // _LOG4CXX_NET_SYSLOG_APPENDER_H
 
diff --git a/src/main/include/log4cxx/net/telnetappender.h 
b/src/main/include/log4cxx/net/telnetappender.h
index c5e0812a..42b3db03 100644
--- a/src/main/include/log4cxx/net/telnetappender.h
+++ b/src/main/include/log4cxx/net/telnetappender.h
@@ -18,13 +18,6 @@
 #ifndef _LOG4CXX_NET_TELNET_APPENDER_H
 #define _LOG4CXX_NET_TELNET_APPENDER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
-
 #include <log4cxx/appenderskeleton.h>
 #include <log4cxx/helpers/socket.h>
 #include <log4cxx/helpers/serversocket.h>
@@ -145,10 +138,5 @@ LOG4CXX_PTR_DEF(TelnetAppender);
 } // namespace net
 } // namespace log4cxx
 
-
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif // _LOG4CXX_NET_TELNET_APPENDER_H
 
diff --git a/src/main/include/log4cxx/nt/nteventlogappender.h 
b/src/main/include/log4cxx/nt/nteventlogappender.h
index ab9551c2..6ae09e4e 100644
--- a/src/main/include/log4cxx/nt/nteventlogappender.h
+++ b/src/main/include/log4cxx/nt/nteventlogappender.h
@@ -20,12 +20,6 @@
 
 #include <log4cxx/appenderskeleton.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
-
 namespace log4cxx
 {
 namespace nt
@@ -104,7 +98,4 @@ LOG4CXX_PTR_DEF(NTEventLogAppender);
 }  // namespace nt
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
 #endif //_LOG4CXX_NT_EVENT_LOG_APPENDER_HEADER_
diff --git a/src/main/include/log4cxx/pattern/literalpatternconverter.h 
b/src/main/include/log4cxx/pattern/literalpatternconverter.h
index b582bdbd..45b71829 100644
--- a/src/main/include/log4cxx/pattern/literalpatternconverter.h
+++ b/src/main/include/log4cxx/pattern/literalpatternconverter.h
@@ -20,11 +20,6 @@
 
 #include <log4cxx/pattern/loggingeventpatternconverter.h>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4251 )
-#endif
-
 namespace log4cxx
 {
 namespace pattern
@@ -66,9 +61,5 @@ class LOG4CXX_EXPORT LiteralPatternConverter : public 
LoggingEventPatternConvert
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif
 
diff --git a/src/main/include/log4cxx/pattern/patternparser.h 
b/src/main/include/log4cxx/pattern/patternparser.h
index 39f45291..2c328ae3 100644
--- a/src/main/include/log4cxx/pattern/patternparser.h
+++ b/src/main/include/log4cxx/pattern/patternparser.h
@@ -19,13 +19,6 @@
 #ifndef _LOG4CXX_HELPER_PATTERN_CONVERTER_H
 #define _LOG4CXX_HELPER_PATTERN_CONVERTER_H
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
-
 #include <map>
 #include <vector>
 #include <log4cxx/helpers/class.h>
@@ -167,9 +160,4 @@ class LOG4CXX_EXPORT PatternParser
 }
 
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
-
 #endif
diff --git a/src/main/include/log4cxx/propertyconfigurator.h 
b/src/main/include/log4cxx/propertyconfigurator.h
index 4cdfc3db..31d20ab4 100644
--- a/src/main/include/log4cxx/propertyconfigurator.h
+++ b/src/main/include/log4cxx/propertyconfigurator.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_PROPERTY_CONFIGURATOR_H
 #define _LOG4CXX_PROPERTY_CONFIGURATOR_H
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/helpers/object.h>
 #include <log4cxx/logstring.h>
 #include <log4cxx/spi/configurator.h>
@@ -48,6 +42,7 @@ class Properties;
 namespace spi
 {
 class LoggerFactory;
+typedef std::shared_ptr<LoggerFactory> LoggerFactoryPtr;
 }
 
 class PropertyWatchdog;
@@ -103,7 +98,7 @@ class LOG4CXX_EXPORT PropertyConfigurator :
                /**
                Used to create new instances of logger
                */
-               std::shared_ptr<spi::LoggerFactory> loggerFactory;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(spi::LoggerFactoryPtr, 
loggerFactory)
 
        public:
                DECLARE_LOG4CXX_OBJECT(PropertyConfigurator)
@@ -386,9 +381,5 @@ class LOG4CXX_EXPORT PropertyConfigurator :
 }; // class PropertyConfigurator
 }  // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 
 #endif //_LOG4CXX_PROPERTY_CONFIGURATOR_H
diff --git a/src/main/include/log4cxx/rolling/gzcompressaction.h 
b/src/main/include/log4cxx/rolling/gzcompressaction.h
index f74f70a9..ef01cd47 100644
--- a/src/main/include/log4cxx/rolling/gzcompressaction.h
+++ b/src/main/include/log4cxx/rolling/gzcompressaction.h
@@ -18,11 +18,6 @@
 #if !defined(_LOG4CXX_ROLLING_GZ_COMPRESS_ACTION_H)
 #define _LOG4CXX_ROLLING_GZ_COMPRESS_ACTION_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/rolling/action.h>
 #include <log4cxx/file.h>
 
@@ -67,9 +62,5 @@ LOG4CXX_PTR_DEF(GZCompressAction);
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif
 
diff --git a/src/main/include/log4cxx/rolling/rolloverdescription.h 
b/src/main/include/log4cxx/rolling/rolloverdescription.h
index eabb29f6..a61fc8b3 100644
--- a/src/main/include/log4cxx/rolling/rolloverdescription.h
+++ b/src/main/include/log4cxx/rolling/rolloverdescription.h
@@ -35,7 +35,7 @@ class RolloverDescription : public log4cxx::helpers::Object
                /**
                 * Active log file name after rollover.
                 */
-               LogString activeFileName;
+               LOG4CXX_DECLARE_PRIVATE_MEMBER(LogString, activeFileName)
 
                /**
                 * Should active file be opened for appending.
diff --git a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h 
b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h
index 69bf4469..cdbe65bc 100755
--- a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h
+++ b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h
@@ -25,11 +25,6 @@
 #include <log4cxx/helpers/outputstream.h>
 #include <functional>
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4250 )
-#endif
-
 namespace log4cxx
 {
 
@@ -142,8 +137,8 @@ namespace rolling
  * the {@link #activateOptions} method of the owning
  * <code>RollingFileAppender</code>.
  */
-class LOG4CXX_EXPORT TimeBasedRollingPolicy : public RollingPolicyBase,
-       public TriggeringPolicy
+class LOG4CXX_EXPORT TimeBasedRollingPolicy : public virtual RollingPolicyBase,
+       public virtual TriggeringPolicy
 {
                DECLARE_LOG4CXX_OBJECT(TimeBasedRollingPolicy)
                BEGIN_LOG4CXX_CAST_MAP()
@@ -195,6 +190,7 @@ class LOG4CXX_EXPORT TimeBasedRollingPolicy : public 
RollingPolicyBase,
                        const LogString& filename,
                        size_t fileLength) override;
 
+               using RollingPolicyBase::setOption;
        protected:
                log4cxx::pattern::PatternMap getFormatSpecifiers() const 
override;
 
@@ -237,9 +233,5 @@ LOG4CXX_PTR_DEF(TimeBasedRollingPolicy);
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif
 
diff --git a/src/main/include/log4cxx/rolling/zipcompressaction.h 
b/src/main/include/log4cxx/rolling/zipcompressaction.h
index 5ed0a555..126cf06a 100644
--- a/src/main/include/log4cxx/rolling/zipcompressaction.h
+++ b/src/main/include/log4cxx/rolling/zipcompressaction.h
@@ -18,12 +18,6 @@
 #if !defined(_LOG4CXX_ROLLING_ZIP_COMPRESS_ACTION_H)
 #define _LOG4CXX_ROLLING_ZIP_COMPRESS_ACTION_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/rolling/action.h>
 #include <log4cxx/file.h>
 
@@ -66,10 +60,6 @@ LOG4CXX_PTR_DEF(ZipCompressAction);
 
 }
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 }
 #endif
 
diff --git a/src/main/include/log4cxx/simplelayout.h 
b/src/main/include/log4cxx/simplelayout.h
index 9bb4f9f4..080d033c 100644
--- a/src/main/include/log4cxx/simplelayout.h
+++ b/src/main/include/log4cxx/simplelayout.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_SIMPLE_LAYOUT_H
 #define _LOG4CXX_SIMPLE_LAYOUT_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/layout.h>
 
 namespace log4cxx
@@ -78,9 +72,4 @@ class LOG4CXX_EXPORT SimpleLayout : public Layout
 LOG4CXX_PTR_DEF(SimpleLayout);
 }  // namespace log4cxx
 
-
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif //_LOG4CXX_SIMPLE_LAYOUT_H
diff --git a/src/main/include/log4cxx/spi/appenderattachable.h 
b/src/main/include/log4cxx/spi/appenderattachable.h
index 0bb532f6..6fb14613 100644
--- a/src/main/include/log4cxx/spi/appenderattachable.h
+++ b/src/main/include/log4cxx/spi/appenderattachable.h
@@ -18,11 +18,6 @@
 #ifndef _LOG4CXX_SPI_APPENDER_ATTACHABLE_H_
 #define _LOG4CXX_SPI_APPENDER_ATTACHABLE_H_
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/logstring.h>
 #include <vector>
 #include <log4cxx/helpers/object.h>
@@ -86,8 +81,5 @@ LOG4CXX_PTR_DEF(AppenderAttachable);
 }
 }
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
 
 #endif //_LOG4CXX_SPI_APPENDER_ATTACHABLE_H_
diff --git a/src/main/include/log4cxx/spi/errorhandler.h 
b/src/main/include/log4cxx/spi/errorhandler.h
index 09b90542..5d8b7d3a 100644
--- a/src/main/include/log4cxx/spi/errorhandler.h
+++ b/src/main/include/log4cxx/spi/errorhandler.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_SPI_ERROR_HANDLER_H
 #define _LOG4CXX_SPI_ERROR_HANDLER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/spi/optionhandler.h>
 #include <log4cxx/helpers/exception.h>
 #include <log4cxx/appender.h>
@@ -125,8 +119,4 @@ LOG4CXX_PTR_DEF(ErrorHandler);
 }  //namespace spi
 } //namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif //_LOG4CXX_SPI_ERROR_HANDLER_H
diff --git a/src/main/include/log4cxx/spi/hierarchyeventlistener.h 
b/src/main/include/log4cxx/spi/hierarchyeventlistener.h
index d58128e2..c8f6af51 100644
--- a/src/main/include/log4cxx/spi/hierarchyeventlistener.h
+++ b/src/main/include/log4cxx/spi/hierarchyeventlistener.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_SPI_HIERARCHY_EVENT_LISTENER_H
 #define _LOG4CXX_SPI_HIERARCHY_EVENT_LISTENER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/helpers/object.h>
 #include <vector>
 
@@ -57,8 +51,4 @@ LOG4CXX_LIST_DEF(HierarchyEventListenerList, 
HierarchyEventListenerPtr);
 }  // namespace spi
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif //_LOG4CXX_SPI_HIERARCHY_EVENT_LISTENER_H
diff --git a/src/main/include/log4cxx/spi/loggerrepository.h 
b/src/main/include/log4cxx/spi/loggerrepository.h
index baf16e12..1bb79040 100644
--- a/src/main/include/log4cxx/spi/loggerrepository.h
+++ b/src/main/include/log4cxx/spi/loggerrepository.h
@@ -18,12 +18,6 @@
 #ifndef _LOG4CXX_SPI_LOG_REPOSITORY_H
 #define _LOG4CXX_SPI_LOG_REPOSITORY_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
-
 #include <log4cxx/appender.h>
 #include <log4cxx/spi/loggerfactory.h>
 #include <log4cxx/level.h>
@@ -116,9 +110,4 @@ class LOG4CXX_EXPORT LoggerRepository : public virtual 
helpers::Object
 }  // namespace spi
 } // namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
-
 #endif //_LOG4CXX_SPI_LOG_REPOSITORY_H
diff --git a/src/main/include/log4cxx/writerappender.h 
b/src/main/include/log4cxx/writerappender.h
index bf07f5c0..31f0b89c 100644
--- a/src/main/include/log4cxx/writerappender.h
+++ b/src/main/include/log4cxx/writerappender.h
@@ -18,11 +18,6 @@
 #ifndef _LOG4CXX_WRITER_APPENDER_H
 #define _LOG4CXX_WRITER_APPENDER_H
 
-#if defined(_MSC_VER)
-       #pragma warning ( push )
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <log4cxx/appenderskeleton.h>
 #include <log4cxx/helpers/outputstreamwriter.h>
 #include <log4cxx/boost-std-configuration.h>
@@ -192,8 +187,4 @@ LOG4CXX_PTR_DEF(WriterAppender);
 
 }  //namespace log4cxx
 
-#if defined(_MSC_VER)
-       #pragma warning ( pop )
-#endif
-
 #endif //_LOG4CXX_WRITER_APPENDER_H
diff --git a/src/test/cpp/logunit.cpp b/src/test/cpp/logunit.cpp
index 24331f78..3e044b89 100644
--- a/src/test/cpp/logunit.cpp
+++ b/src/test/cpp/logunit.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include "logunit.h"
 
diff --git a/src/test/cpp/logunit.h b/src/test/cpp/logunit.h
index 6b8fbe35..2e0e3d9e 100644
--- a/src/test/cpp/logunit.h
+++ b/src/test/cpp/logunit.h
@@ -18,12 +18,6 @@
 #if !defined(_LOG4CXX_LOGUNIT_H)
 #define _LOG4CXX_LOGUNIT_H
 
-
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include "abts.h"
 #include <exception>
 #include <map>
@@ -274,10 +268,5 @@ class RegisterDisabledSuite
 #define LOGUNIT_ASSERT_EQUAL_SRCL(  expected, actual, srcLine)  
assertEquals(expected, actual, #expected, #actual, srcLine)
 #define LOGUNIT_FAIL(msg)                                       throw 
LogUnit::AssertException(msg, __LINE__)
 
-
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif
 
diff --git a/src/test/cpp/pattern/num343patternconverter.cpp 
b/src/test/cpp/pattern/num343patternconverter.cpp
index 2ff67dbc..18d02cab 100644
--- a/src/test/cpp/pattern/num343patternconverter.cpp
+++ b/src/test/cpp/pattern/num343patternconverter.cpp
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#if defined(_MSC_VER)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
 
 #include <log4cxx/logstring.h>
 #include "num343patternconverter.h"
diff --git a/src/test/cpp/util/filter.h b/src/test/cpp/util/filter.h
index 18b6dc69..c52eb37f 100644
--- a/src/test/cpp/util/filter.h
+++ b/src/test/cpp/util/filter.h
@@ -18,11 +18,6 @@
 #ifndef _LOG4CXX_TESTS_UTIL_FILTER_H
 #define _LOG4CXX_TESTS_UTIL_FILTER_H
 
-#if defined(_MSC_VER)
-       #pragma warning (push)
-       #pragma warning ( disable: 4231 4251 4275 4786 )
-#endif
-
 #include <string>
 #include <vector>
 #include <map>
@@ -63,8 +58,4 @@ class Filter
 };
 }
 
-#if defined(_MSC_VER)
-       #pragma warning (pop)
-#endif
-
 #endif //_LOG4CXX_TESTS_UTIL_FILTER_H

Reply via email to