diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2010-11-24 12:28:07 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2010-11-25 11:52:33 +0100 |
commit | 2a462c138b52e0c211e8e344e461a2721a09b7cf (patch) | |
tree | 363d955699ee697f24819abc5c98d75c268f7761 /sal/inc/osl/diagnose.h | |
parent | 3ef6b198520e58f6ceb6026cea0a8c6636fb6d1c (diff) |
OSL_THIS_FUNC: use logic from boot/current_function.hpp
Don't use it directly, as OSL_THIS_FUNC is used in C-only sources as
well. Also, remove OSL_THIS_FUNC from OSL_LOG_PREFIX as concatenation
does not work non-macros like __PRETTY_FUNCTION__. (The code actually
worked there only because it was defined to be " ", so we are not
removing any valuable information.)
Diffstat (limited to 'sal/inc/osl/diagnose.h')
-rw-r--r-- | sal/inc/osl/diagnose.h | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/sal/inc/osl/diagnose.h b/sal/inc/osl/diagnose.h index 699703b73f1b..a848e0900e16 100644 --- a/sal/inc/osl/diagnose.h +++ b/sal/inc/osl/diagnose.h @@ -78,23 +78,6 @@ pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pf #define OSL_THIS_FILE __FILE__ -/* the macro OSL_THIS_FUNC is intended to be an office internal macro for now */ -/* as documented in http://www.openoffice.org/issues/show_bug.cgi?id=114290 , - this cannot work, so disable it for now */ -#if 1 -#define OSL_THIS_FUNC " " -#else -#ifdef __func__ -#define OSL_THIS_FUNC __func__ -#elif defined (__PRETTY_FUNCTION__) -#define OSL_THIS_FUNC __PRETTY_FUNCTION__ -#elif defined (__FUNCTION__) -#define OSL_THIS_FUNC __FUNCTION__ -#else -#define OSL_THIS_FUNC " " -#endif -#endif /* 1 */ - /* the macro OSL_TO_STRING is intended to be an office internal macro for now */ #define OSL_TO_STRING( x ) #x @@ -102,7 +85,7 @@ pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pf #define OSL_MACRO_VALUE_TO_STRING( x ) OSL_TO_STRING( x ) /* the macro OSL_LOG_PREFIX is intended to be an office internal macro for now */ -#define OSL_LOG_PREFIX OSL_THIS_FILE ":" OSL_THIS_FUNC ":" OSL_MACRO_VALUE_TO_STRING( __LINE__ ) "; " +#define OSL_LOG_PREFIX OSL_THIS_FILE ":" OSL_MACRO_VALUE_TO_STRING( __LINE__ ) "; " #define OSL_DEBUG_ONLY(s) _OSL_DEBUG_ONLY(s) #define OSL_TRACE _OSL_TRACE @@ -164,6 +147,31 @@ pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pf #endif /* OSL_DEBUG_LEVEL */ +/* the macro OSL_THIS_FUNC is intended to be an office internal macro for now */ +/* copied from boost/current_function.hpp to make it usable from C + * sources as well + * + * Copyright (c) 2002 Peter Dimov and Multi Media Ltd. + * + * Distributed under the Boost Software License, Version 1.0. (See + * accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) */ +#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) +#define OSL_THIS_FUNC __PRETTY_FUNCTION__ +#elif defined(__DMC__) && (__DMC__ >= 0x810) +#define OSL_THIS_FUNC __PRETTY_FUNCTION__ +#elif defined(__FUNCSIG__) +#define OSL_THIS_FUNC __FUNCSIG__ +#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500)) +#define OSL_THIS_FUNC __FUNCTION__ +#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550) +#define OSL_THIS_FUNC __FUNC__ +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) +#define OSL_THIS_FUNC __func__ +#else +#define OSL_THIS_FUNC "" +#endif + #endif /* _OSL_DIAGNOSE_H_ */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |