diff options
author | Don Lewis <truckman@apache.org> | 2016-03-25 16:26:21 +0000 |
---|---|---|
committer | Don Lewis <truckman@apache.org> | 2016-03-25 16:26:21 +0000 |
commit | 2cf713b56abbd798212dd3527bf3ead910421f43 (patch) | |
tree | 62308c42d613118665123f722877a17a5ec1ae09 /sal | |
parent | 0adb92d44d96cbedb94d8bbc47b47707135ccf88 (diff) |
#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.
Notes
Notes:
reject: sal depending on tools is *insane*
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/rtl/string.hxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index c3ce09bbb9ac..346d949a9fac 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -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 */ |