summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compilerplugins/clang/checkconfigmacros.cxx11
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitInit.h9
-rw-r--r--libreofficekit/qa/unit/tiledrendering.cxx2
3 files changed, 18 insertions, 4 deletions
diff --git a/compilerplugins/clang/checkconfigmacros.cxx b/compilerplugins/clang/checkconfigmacros.cxx
index 74a45db151ed..6dea3cebc81b 100644
--- a/compilerplugins/clang/checkconfigmacros.cxx
+++ b/compilerplugins/clang/checkconfigmacros.cxx
@@ -129,9 +129,14 @@ void CheckConfigMacros::checkMacro( const Token& macroToken, SourceLocation loca
{
if( configMacros.find( macroToken.getIdentifierInfo()->getName()) != configMacros.end())
{
- report( DiagnosticsEngine::Error, "checking whether a config macro %0 is defined",
- location ) << macroToken.getIdentifierInfo()->getName();
- report( DiagnosticsEngine::Note, "use #if instead of #ifdef/#ifndef/defined", location );
+ const char* filename = compiler.getSourceManager().getPresumedLoc( location ).getFilename();
+ if( filename == NULL
+ || strncmp( filename, SRCDIR "/include/LibreOfficeKit/", strlen( SRCDIR "/include/LibreOfficeKit/" )) != 0 )
+ {
+ report( DiagnosticsEngine::Error, "checking whether a config macro %0 is defined",
+ location ) << macroToken.getIdentifierInfo()->getName();
+ report( DiagnosticsEngine::Note, "use #if instead of #ifdef/#ifndef/defined", location );
+ }
}
}
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 18731b7b7f9f..6f56c728def5 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -39,7 +39,14 @@ extern "C"
void *_dlopen(const char *pFN)
{
- return dlopen(pFN, RTLD_LAZY);
+ return dlopen(pFN, RTLD_LAZY
+#if defined __clang__ && defined __linux__ \
+ && defined ENABLE_RUNTIME_OPTIMIZATIONS
+#if !ENABLE_RUNTIME_OPTIMIZATIONS
+ | RTLD_GLOBAL
+#endif
+#endif
+ );
}
void *_dlsym(void *Hnd, const char *pName)
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index 4e13f0881da6..7c956e6d0ec4 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -19,6 +19,8 @@
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
+#include <config_options.h>
+ // see use of ENABLE_RUNTIME_OPTIMIZATIONS in LibreOfficeKintInit.h
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include <LibreOfficeKit/LibreOfficeKit.hxx>