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 ca...@apache.org on 2007/11/28 06:59:35 UTC

svn commit: r598875 - in /logging/log4cxx/trunk/src/main: cpp/logstream.cpp include/log4cxx/log4cxx.hw include/log4cxx/stream.h

Author: carnold
Date: Tue Nov 27 21:59:34 2007
New Revision: 598875

URL: http://svn.apache.org/viewvc?rev=598875&view=rev
Log:
LOGCXX-18: Reintroducing nop manipulator for VC6 ambiguity I can't reproduce

Modified:
    logging/log4cxx/trunk/src/main/cpp/logstream.cpp
    logging/log4cxx/trunk/src/main/include/log4cxx/log4cxx.hw
    logging/log4cxx/trunk/src/main/include/log4cxx/stream.h

Modified: logging/log4cxx/trunk/src/main/cpp/logstream.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/cpp/logstream.cpp?rev=598875&r1=598874&r2=598875&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/cpp/logstream.cpp (original)
+++ logging/log4cxx/trunk/src/main/cpp/logstream.cpp Tue Nov 27 21:59:34 2007
@@ -74,6 +74,10 @@
      return stream;
 }
 
+logstream_base& logstream_base::nop(logstream_base& stream) {
+     return stream;
+}
+
 void logstream_base::end_message() {
      if (isEnabled()) {
          log(logger, level, location);
@@ -203,6 +207,10 @@
    return *this;
 }
 
+logstream& logstream::operator>>(const log4cxx::spi::LocationInfo& newlocation) {
+   setLocation(newlocation);
+   return *this;
+}
              
 logstream& logstream::operator<<(std::ios_base& (*manip)(std::ios_base&)) {
       logstream_base::insert(manip);

Modified: logging/log4cxx/trunk/src/main/include/log4cxx/log4cxx.hw
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/include/log4cxx/log4cxx.hw?rev=598875&r1=598874&r2=598875&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/include/log4cxx/log4cxx.hw (original)
+++ logging/log4cxx/trunk/src/main/include/log4cxx/log4cxx.hw Tue Nov 27 21:59:34 2007
@@ -37,6 +37,7 @@
 typedef __int64 log4cxx_int64_t;
 #if _MSC_VER < 1300
 #define LOG4CXX_USE_GLOBAL_SCOPE_TEMPLATE 1
+#define LOG4CXX_LOGSTREAM_ADD_NOP 1
 #endif
 #else
 typedef long long log4cxx_int64_t;

Modified: logging/log4cxx/trunk/src/main/include/log4cxx/stream.h
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/include/log4cxx/stream.h?rev=598875&r1=598874&r2=598875&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/include/log4cxx/stream.h (original)
+++ logging/log4cxx/trunk/src/main/include/log4cxx/stream.h Tue Nov 27 21:59:34 2007
@@ -99,6 +99,10 @@
               */
              static logstream_base& endmsg(logstream_base&);
 
+             /**
+              *  no-operation manipulator,  Used to avoid ambiguity with VC6.
+              */
+             static logstream_base& nop(logstream_base&);
              
              /**
               *   end of message action.
@@ -258,6 +262,11 @@
              */
              logstream& operator<<(const log4cxx::spi::LocationInfo& location);
             
+            /**
+             *   Alias for insertion operator for location.  Kludge to avoid
+			 *      inappropriate compiler ambiguity.
+             */
+             logstream& operator>>(const log4cxx::spi::LocationInfo& location);
 
             /**
              *   Cast operator to provide access to embedded std::basic_ostream.
@@ -351,9 +360,9 @@
              wlogstream& operator<<(std::ios_base& (*manip)(std::ios_base&));
             
              /**
-              *   Insertion operator for wlogstream_base::endmsg.
+              *   Insertion operator for logstream_base::endmsg.
               */
-              wlogstream& operator<<(logstream_base& (*manip)(logstream_base&));
+              wlogstream& operator<<(logstream_manipulator manip);
             
               /**
                *   Insertion operator for level.
@@ -463,7 +472,11 @@
 #endif
 
 #if !defined(LOG4CXX_ENDMSG)
+#if LOG4CXX_LOGSTREAM_ADD_NOP
+#define LOG4CXX_ENDMSG (log4cxx::logstream_manipulator) log4cxx::logstream_base::nop >> LOG4CXX_LOCATION << (log4cxx::logstream_manipulator) log4cxx::logstream_base::endmsg;
+#else
 #define LOG4CXX_ENDMSG LOG4CXX_LOCATION << (log4cxx::logstream_manipulator) log4cxx::logstream_base::endmsg;
+#endif
 #endif