[Libreoffice] ucb/source/ucb compilation error

Miklos Vajna vmiklos at frugalware.org
Thu Nov 25 02:17:41 PST 2010


On Thu, Nov 25, 2010 at 10:11:40AM +0000, Michael Meeks <michael.meeks at novell.com> wrote:
> 	Looks great to me; if we took this chunk of code from boost though - we
> should include the relevant boost license header and copyright statement
> at the end of that file, and separate out the section it applies to
> IMHO.

OK - I'm attaching an updated patch, containing the license.
-------------- next part --------------
From 60f7f1fa481f9aeb7c96d4fddbe0757a53df88d0 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos at frugalware.org>
Date: Wed, 24 Nov 2010 12:28:07 +0100
Subject: [PATCH] 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.)
---
 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 59f921c..35def37 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 "(unknown)"
+#endif
+
 #endif /* _OSL_DIAGNOSE_H_ */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-- 
1.7.3.2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101125/b6d7c162/attachment.pgp>


More information about the LibreOffice mailing list