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/05/12 18:09:53 UTC

svn commit: r537476 - in /logging/log4cxx/trunk: build.xml configure.in include/log4cxx/log4cxx.h.in include/log4cxx/log4cxx.hw include/log4cxx/private/log4cxx_private.h.in include/log4cxx/private/log4cxx_private.hw

Author: afester
Date: Sat May 12 09:09:52 2007
New Revision: 537476

URL: http://svn.apache.org/viewvc?view=rev&rev=537476
Log:
LOGCXX-126: fix build failure of console.cpp on systems with no wchar_t support,
removed hard coded HAS_STD_WCOUT.

Modified:
    logging/log4cxx/trunk/build.xml
    logging/log4cxx/trunk/configure.in
    logging/log4cxx/trunk/include/log4cxx/log4cxx.h.in
    logging/log4cxx/trunk/include/log4cxx/log4cxx.hw
    logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.h.in
    logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.hw

Modified: logging/log4cxx/trunk/build.xml
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/build.xml?view=diff&rev=537476&r1=537475&r2=537476
==============================================================================
--- logging/log4cxx/trunk/build.xml (original)
+++ logging/log4cxx/trunk/build.xml Sat May 12 09:09:52 2007
@@ -65,6 +65,7 @@
 <property name="optimize" value="none"/>
 <property name="lib.type" value="shared"/>
 <property name="has.wchar_t" value="1"/>
+<property name="has.wcout" value="1"/>
 
 <property name="apache.mirror" value="http://archive.apache.org/dist"/>
 <property name="cppunit.mirror" value="http://easynews.dl.sourceforge.net/sourceforge"/>
@@ -143,6 +144,7 @@
 -Dapr.dir=PATH
 -Daprutil.dir=PATH
 -Dhas.wchar_t=[0|1] (default=1)
+-Dhas.wcout=[0|1] (default=1)
 -Dlogchar=[utf-8|wchar_t|cfstring] (default=wchar_t)
 
 </echo>
@@ -440,6 +442,7 @@
                                   unix-configure,
                                   win-configure">
     <echo message="Configuring with has.wchar_t=${has.wchar_t}"/>
+    <echo message="Configuring with has.wcout=${has.wcout}"/>
     <echo message="Configuring with logchar_type=${logchar_type}" />
 
     <condition property="logchar_is_utf8" value="1">
@@ -472,6 +475,10 @@
     <replaceregexp file="${include.dir}/log4cxx/log4cxx.h"
        match="@HAS_WCHAR_T@"
        replace="${has.wchar_t}"/>
+
+    <replaceregexp file="${include.dir}/log4cxx/log4cxx.h"
+       match="@HAS_STD_WCOUT@"
+       replace="${has.wcout}"/>
 
     <!-- The MS Windows template for log4cxx_private.h contains a hard coded
          "0" for LOG4CXX_HAVE_SYSLOG. Therefore the following replacement

Modified: logging/log4cxx/trunk/configure.in
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/configure.in?view=diff&rev=537476&r1=537475&r2=537476
==============================================================================
--- logging/log4cxx/trunk/configure.in (original)
+++ logging/log4cxx/trunk/configure.in Sat May 12 09:09:52 2007
@@ -350,6 +350,21 @@
         ;;
 esac
 
+#for wide streams
+AC_MSG_CHECKING(for wcout)
+AC_COMPILE_IFELSE(AC_LANG_SOURCE([[
+                  #include <iostream>
+                  int main() { std::wcout << L"Hello"; } ]]), [have_wcout=yes], [have_wcout=no])
+AC_MSG_RESULT($have_wcout)
+
+if test "$have_wcout" = "yes"
+then
+    AC_SUBST(HAS_STD_WCOUT, 1)
+else
+    AC_SUBST(HAS_STD_WCOUT, 0)
+fi
+
+
 # Create files
 # ----------------------------------------------------------------------------
 

Modified: logging/log4cxx/trunk/include/log4cxx/log4cxx.h.in
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/log4cxx.h.in?view=diff&rev=537476&r1=537475&r2=537476
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/log4cxx.h.in (original)
+++ logging/log4cxx/trunk/include/log4cxx/log4cxx.h.in Sat May 12 09:09:52 2007
@@ -30,6 +30,7 @@
 #define LOG4CXX_LOGCHAR_IS_WCHAR @LOGCHAR_IS_WCHAR@
 
 #define LOG4CXX_HAS_WCHAR_T @HAS_WCHAR_T@
+#define LOG4CXX_HAS_STD_WCOUT @HAS_STD_WCOUT@
 
 #define LOG4CXX_EXPORT
 

Modified: logging/log4cxx/trunk/include/log4cxx/log4cxx.hw
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/log4cxx.hw?view=diff&rev=537476&r1=537475&r2=537476
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/log4cxx.hw (original)
+++ logging/log4cxx/trunk/include/log4cxx/log4cxx.hw Sat May 12 09:09:52 2007
@@ -31,6 +31,7 @@
 #endif
 
 #define LOG4CXX_HAS_WCHAR_T 1
+#define LOG4CXX_HAS_STD_WCOUT 1
 
 #if defined(_MSC_VER)
 typedef __int64 log4cxx_int64_t;

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=537476&r1=537475&r2=537476
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.h.in (original)
+++ logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.h.in Sat May 12 09:09:52 2007
@@ -37,7 +37,6 @@
 
 #define LOG4CXX_RETURN_AFTER_THROW 0
 
-#define LOG4CXX_HAS_STD_WCOUT 1
 #define LOG4CXX_HAS_STD_WLOCALE 1
 #define LOG4CXX_FORCE_WIDE_CONSOLE 0
 

Modified: logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.hw
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.hw?view=diff&rev=537476&r1=537475&r2=537476
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.hw (original)
+++ logging/log4cxx/trunk/include/log4cxx/private/log4cxx_private.hw Sat May 12 09:09:52 2007
@@ -53,7 +53,6 @@
 #define LOG4CXX_HAS_STD_WLOCALE 1
 #endif
 
-#define LOG4CXX_HAS_STD_WCOUT 1
 #define LOG4CXX_HAS_STD_WLOCALE 1
 #define LOG4CXX_FORCE_WIDE_CONSOLE 1