Author: truckman
Date: Fri Mar 25 16:26:21 2016
New Revision: 1736611

URL: http://svn.apache.org/viewvc?rev=1736611&view=rev
Log:
#i126890# code: compiling with recent clang generates thousands of infinite-recu
rsion warnings about DbgOut()

If the definition of the overloaded function DbgOut() in
sal/inc/rtl/string.hxx is compiled without having first compiling
the the declaration of DbgOut() with a different signature in
tools/inc/tools/debug.hxx, the compiler thinks DbgOut() is calling
itself recursively with no means of escape.
 
Fix this in the case where DBG_UTIL is defined by including
<tools/debug.hxx> inside string.hxx so that the compiler will 
encounter the declaration of DbgOut() in debug.hxx first in this
case.  This requires adding a couple of directories to the compiler
include path so that the new consumers of <tools/debug.hxx> can 
find it as well as one of its dependencies.

If DBG_UTIL is not defined, then debug.hxx does not declare DbgOut(),
so fix this case by hiding the DbgOut() definition in string.hxx
behind #ifdef DBG_UTIL since it won't be used in this case.


Modified:
    openoffice/trunk/main/sal/inc/rtl/string.hxx
    openoffice/trunk/main/set_soenv.in

Modified: openoffice/trunk/main/sal/inc/rtl/string.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/sal/inc/rtl/string.hxx?rev=1736611&r1=1736610&r2=1736611&view=diff
==============================================================================
--- openoffice/trunk/main/sal/inc/rtl/string.hxx (original)
+++ openoffice/trunk/main/sal/inc/rtl/string.hxx Fri Mar 25 16:26:21 2016
@@ -32,6 +32,9 @@
 #include <rtl/memory.h>
 #include <rtl/textenc.h>
 #include <rtl/string.h>
+#ifdef DBG_UTIL
+#include <tools/debug.hxx>
+#endif /* DBG_UTIL */
 
 #if !defined EXCEPTIONS_OFF
 #include <new>
@@ -969,8 +972,10 @@ struct CStringHash
 /* Helper methods to support OString messages in OSL_ENSURE, DBG_ERROR, 
DBG_WARN, DBG_TRACE, etc. */
 inline sal_Bool SAL_CALL osl_assertFailedLine( const sal_Char* pszFileName, 
sal_Int32 nLine, const ::rtl::OString& rMessage)
        { return osl_assertFailedLine( pszFileName, nLine, rMessage.getStr()); }
+#ifdef DBG_UTIL
 inline void DbgOut( const rtl::OString& rMessage, sal_uInt16 nOutType, const 
sal_Char* pFileName, sal_uInt16 nLineNum )
        { DbgOut( rMessage.getStr(), nOutType, pFileName, nLineNum); }
+#endif /* DBG_UTIL */
 
 #endif /* __cplusplus */
 

Modified: openoffice/trunk/main/set_soenv.in
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/set_soenv.in?rev=1736611&r1=1736610&r2=1736611&view=diff
==============================================================================
--- openoffice/trunk/main/set_soenv.in (original)
+++ openoffice/trunk/main/set_soenv.in Fri Mar 25 16:26:21 2016
@@ -1380,7 +1380,9 @@ $SOLARINC             = $I.$cur_dir.
                         $I.'$SOLARVER'.$ds.'$INPATH'.$INC.
                         $I.'$SOLARENV'.$ds.'$OUTPATH'.$INC.
                         $I.'$SOLARENV'.$INC.
-                        $I.'$SRC_ROOT'.$ds."res";
+                        $I.'$SRC_ROOT'.$ds."res".
+                        $I.'$SRC_ROOT'.$ds."tools".$INC.
+                        $I.'$SRC_ROOT'.$ds."comphelper".$INC;
 
 if ($platform =~ m/solaris|linux|osf1|freebsd|netbsd/)
 {


Reply via email to