On 05/12/09 11:43, [email protected] wrote:
Author: mav
Date: Tue May 12 09:39:38 2009
New Revision: 271808
Log:
#i101356# allow to generate a small log if a document can not be stored
Modified:
cws/fwk103/sal/inc/osl/diagnose.h
Modified: cws/fwk103/sal/inc/osl/diagnose.h
==============================================================================
--- cws/fwk103/sal/inc/osl/diagnose.h Tue May 12 09:38:00 2009
(r271807)
+++ cws/fwk103/sal/inc/osl/diagnose.h Tue May 12 09:39:38 2009
(r271808)
@@ -80,6 +80,23 @@
#define OSL_THIS_FILE __FILE__
+#ifdef __func__
+#define OSL_THIS_FUNC __func__
+#elifdef __PRETTY_FUNCTION__
+#define OSL_THIS_FUNC __PRETTY_FUNCTION__
+#elifdef __FUNCTION__
+#define OSL_THIS_FUNC __FUNCTION__
+#else
+#define OSL_THIS_FUNC " "
+#endif
+
+#define OSL_TO_STRING( x ) #x
+#define OSL_MACRO_VALUE_TO_STRING( x ) OSL_TO_STRING( x )
+#define OSL_STRING_LINE OSL_MACRO_VALUE_TO_STRING( __LINE__ )
+
+#define OSL_LOG_PREFIX OSL_THIS_FILE ":" OSL_THIS_FUNC ":" OSL_STRING_LINE
+#define OSL_LOG_CONSTSTRING( m ) OSL_LOG_PREFIX "; " m
It should be document which of those new macros are part of the stable
URE interface (including @since tags) and which are private.
This is especially true for OSL_TO_STRING and OSL_MACRO_VALUE_TO_STRING,
which are useful in various places, but if added to the stable URE
interface should probably go into a more general header than osl/diagnose.h.
From the "crusade to eliminate every excess macro" camp point of view:
1 The use of OSL_STRING_LINE could be inlined in OSL_LOG_PREFIX, and
OSL_STRING_LINE dropped. 2 Would it work to move the "; " from
OSL_LOG_CONSTSTRING to OSL_LOG_PREFIX, and drop OSL_LOG_CONSTSTRING?
-Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]