You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by af...@apache.org on 2007/01/09 21:20:21 UTC

svn commit: r494555 - in /logging/log4cxx/trunk: include/log4cxx/private/ src/ tests/src/helpers/ tests/src/net/ tests/src/xml/

Author: afester
Date: Tue Jan  9 12:20:20 2007
New Revision: 494555

URL: http://svn.apache.org/viewvc?view=rev&rev=494555
Log:
LOGCXX-14: make sure that macros which are tested with #if are always 
defined (either 0 or 1), otherwise compilation fails when pedantic 
warnings are enabled.

Modified:
    logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.h.in
    logging/log4cxx/trunk/src/charsetdecoder.cpp
    logging/log4cxx/trunk/src/charsetencoder.cpp
    logging/log4cxx/trunk/src/systemerrwriter.cpp
    logging/log4cxx/trunk/src/systemoutwriter.cpp
    logging/log4cxx/trunk/tests/src/helpers/iso8601dateformattestcase.cpp
    logging/log4cxx/trunk/tests/src/net/smtpappendertestcase.cpp
    logging/log4cxx/trunk/tests/src/xml/xmllayouttestcase.cpp

Modified: logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.h.in
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.h.in?view=diff&rev=494555&r1=494554&r2=494555
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.h.in (original)
+++ logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.h.in Tue Jan  9 12:20:20 2007
@@ -38,6 +38,7 @@
 
 #define LOG4CXX_HAS_STD_WCOUT 1
 #define LOG4CXX_HAS_STD_WLOCALE 1
+#define LOG4CXX_FORCE_WIDE_CONSOLE 0
 
 typedef long long log4cxx_int64_t;
 typedef log4cxx_int64_t log4cxx_time_t;

Modified: logging/log4cxx/trunk/src/charsetdecoder.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/charsetdecoder.cpp?view=diff&rev=494555&r1=494554&r2=494555
==============================================================================
--- logging/log4cxx/trunk/src/charsetdecoder.cpp (original)
+++ logging/log4cxx/trunk/src/charsetdecoder.cpp Tue Jan  9 12:20:20 2007
@@ -21,6 +21,7 @@
 #include <log4cxx/helpers/mutex.h>
 #include <log4cxx/helpers/synchronized.h>
 #include <apr_xlate.h>
+#include <log4cxx/private/log4cxx_private.h>
 
 
 using namespace log4cxx;

Modified: logging/log4cxx/trunk/src/charsetencoder.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/charsetencoder.cpp?view=diff&rev=494555&r1=494554&r2=494555
==============================================================================
--- logging/log4cxx/trunk/src/charsetencoder.cpp (original)
+++ logging/log4cxx/trunk/src/charsetencoder.cpp Tue Jan  9 12:20:20 2007
@@ -20,6 +20,7 @@
 #include <apr_xlate.h>
 #include <log4cxx/helpers/stringhelper.h>
 #include <log4cxx/helpers/unicodehelper.h>
+#include <log4cxx/private/log4cxx_private.h>
 
 
 using namespace log4cxx;

Modified: logging/log4cxx/trunk/src/systemerrwriter.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/systemerrwriter.cpp?view=diff&rev=494555&r1=494554&r2=494555
==============================================================================
--- logging/log4cxx/trunk/src/systemerrwriter.cpp (original)
+++ logging/log4cxx/trunk/src/systemerrwriter.cpp Tue Jan  9 12:20:20 2007
@@ -18,6 +18,7 @@
 #include <log4cxx/helpers/systemerrwriter.h>
 #include <log4cxx/helpers/transcoder.h>
 #include <stdio.h>
+#include <log4cxx/private/log4cxx_private.h>
 
 using namespace log4cxx;
 using namespace log4cxx::helpers;

Modified: logging/log4cxx/trunk/src/systemoutwriter.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/systemoutwriter.cpp?view=diff&rev=494555&r1=494554&r2=494555
==============================================================================
--- logging/log4cxx/trunk/src/systemoutwriter.cpp (original)
+++ logging/log4cxx/trunk/src/systemoutwriter.cpp Tue Jan  9 12:20:20 2007
@@ -18,6 +18,7 @@
 #include <log4cxx/helpers/systemoutwriter.h>
 #include <log4cxx/helpers/transcoder.h>
 #include <stdio.h>
+#include <log4cxx/private/log4cxx_private.h>
 
 using namespace log4cxx;
 using namespace log4cxx::helpers;

Modified: logging/log4cxx/trunk/tests/src/helpers/iso8601dateformattestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/helpers/iso8601dateformattestcase.cpp?view=diff&rev=494555&r1=494554&r2=494555
==============================================================================
--- logging/log4cxx/trunk/tests/src/helpers/iso8601dateformattestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/helpers/iso8601dateformattestcase.cpp Tue Jan  9 12:20:20 2007
@@ -16,6 +16,7 @@
 #include <log4cxx/logstring.h>
 #include <log4cxx/helpers/iso8601dateformat.h>
 #include <cppunit/extensions/HelperMacros.h>
+#include <log4cxx/private/log4cxx_private.h>
 #if LOG4CXX_HAS_STD_LOCALE
 #include <locale>
 #endif

Modified: logging/log4cxx/trunk/tests/src/net/smtpappendertestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/net/smtpappendertestcase.cpp?view=diff&rev=494555&r1=494554&r2=494555
==============================================================================
--- logging/log4cxx/trunk/tests/src/net/smtpappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/net/smtpappendertestcase.cpp Tue Jan  9 12:20:20 2007
@@ -14,16 +14,15 @@
  * limitations under the License.
  */
 
+#define LOG4CXX_TEST 1
+#include <log4cxx/private/log4cxx_private.h>
+
 #if LOG4CXX_HAVE_SMTP
 
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 #include <log4cxx/net/smtpappender.h>
 #include "../appenderskeletontestcase.h"
-
-#define LOG4CXX_TEST 1
-#include <log4cxx/private/log4cxx_private.h>
-
 
 using namespace log4cxx;
 using namespace log4cxx::helpers;

Modified: logging/log4cxx/trunk/tests/src/xml/xmllayouttestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/xml/xmllayouttestcase.cpp?view=diff&rev=494555&r1=494554&r2=494555
==============================================================================
--- logging/log4cxx/trunk/tests/src/xml/xmllayouttestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/xml/xmllayouttestcase.cpp Tue Jan  9 12:20:20 2007
@@ -38,10 +38,12 @@
 using namespace log4cxx::helpers;
 using namespace log4cxx::xml;
 
+#ifdef _MSC_VER
 #if _MSC_VER < 1300
 #undef __LOG4CXX_FUNC__
 #define __LOG4CXX_FUNC__ "X::X()"
 #endif
+#endif
 
 class X
 {
@@ -125,7 +127,7 @@
                 XMLThreadFilter xmlThreadFilter;
                 FilenameFilter xmlFilenameFilter(__FILE__, "xmllayouttestcase.cpp");
                 Filter line2XX("[23][0-9][0-9]", "X");
-                Filter line5X("53", "X");
+                Filter line5X("55", "X");
 
                 std::vector<Filter *> filters;
                 filters.push_back(&xmlFilenameFilter);
@@ -147,10 +149,12 @@
                 CPPUNIT_ASSERT(Compare::compare(filteredFile, LOG4CXX_FILE("witness/xmlLayout.2")));
         }
 
+#ifdef _MSC_VER
 #if _MSC_VER < 1300
 #undef __LOG4CXX_FUNC__
 #define __LOG4CXX_FUNC__ "void XMLLayoutTestCase::testCDATA()"
 #endif
+#endif
 
         void testCDATA()
         {
@@ -296,10 +300,11 @@
                 CPPUNIT_ASSERT(Compare::compare(filteredFile, LOG4CXX_FILE("witness/xmlLayout.mdc.2")));
         }
 
-
+#ifdef _MSC_VER
 #if _MSC_VER < 1300
 #undef __LOG4CXX_FUNC__
 #define __LOG4CXX_FUNC__ "void XMLLayoutTestCase::common()"
+#endif
 #endif
 
         void common()