summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-03-18 16:57:22 +0100
committerLuboš Luňák <l.lunak@suse.cz>2013-03-18 17:15:55 +0100
commit8c2711e771bebf1e33f185ff98e4eaed7eb7f95b (patch)
treedc8beb795dd4938e2568f7a24431034a53a2aeb0
parent58d8ad3678d988c86f94a8de3a6c5800336b5800 (diff)
change #ifdef -> #if for KDE4 feature macros
Change-Id: I289744eaa62ad819620f0b31a54efd5ebbdb9dc2
-rw-r--r--config_host/config_kde4.h.in3
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx24
2 files changed, 17 insertions, 10 deletions
diff --git a/config_host/config_kde4.h.in b/config_host/config_kde4.h.in
index 6e5cddf5a5f4..654d2352402c 100644
--- a/config_host/config_kde4.h.in
+++ b/config_host/config_kde4.h.in
@@ -6,5 +6,8 @@ Settings for KDE4 integration.
#define CONFIG_KDE4_H
#undef KDE_HAVE_GLIB
+#ifndef KDE_HAVE_GLIB
+#define KDE_HAVE_GLIB 0
+#endif
#endif
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 86495eb73b4b..ee5735bd4c82 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -47,14 +47,18 @@
#include <config_kde4.h>
#if QT_VERSION >= QT_VERSION_CHECK( 4, 9, 0 )
-#define QT_UNIX_EVENT_LOOP_SUPPORT
+#define QT_UNIX_EVENT_LOOP_SUPPORT 1
+#else
+#define QT_UNIX_EVENT_LOOP_SUPPORT 0
#endif
-#ifdef KDE_HAVE_GLIB
-#define GLIB_EVENT_LOOP_SUPPORT
+#if KDE_HAVE_GLIB
+#define GLIB_EVENT_LOOP_SUPPORT 1
+#else
+#define GLIB_EVENT_LOOP_SUPPORT 0
#endif
-#ifdef GLIB_EVENT_LOOP_SUPPORT
+#if GLIB_EVENT_LOOP_SUPPORT
#include <glib-2.0/glib.h>
#endif
@@ -176,11 +180,11 @@ void KDEXLib::Init()
// needs to be unlocked shortly before entering the main sleep (e.g. select()) and locked
// immediatelly after. So we need to know which event loop implementation is used and
// hook accordingly.
-#ifdef GLIB_EVENT_LOOP_SUPPORT
+#if GLIB_EVENT_LOOP_SUPPORT
static GPollFunc old_gpoll = NULL;
static gint gpoll_wrapper( GPollFD*, guint, gint );
#endif
-#ifdef QT_UNIX_EVENT_LOOP_SUPPORT
+#if QT_UNIX_EVENT_LOOP_SUPPORT
static int (*qt_select)(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
const struct timeval *orig_timeout);
static int lo_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
@@ -200,7 +204,7 @@ static bool qt_event_filter( void* m )
void KDEXLib::setupEventLoop()
{
old_qt_event_filter = QAbstractEventDispatcher::instance()->setEventFilter( qt_event_filter );
-#ifdef GLIB_EVENT_LOOP_SUPPORT
+#if GLIB_EVENT_LOOP_SUPPORT
// Glib is simple, it has g_main_context_set_poll_func() for wrapping the sleep call.
// The catch is that Qt has a bug that allows triggering timers even when they should
// not be, leading to crashes caused by QClipboard re-entering the event loop.
@@ -219,7 +223,7 @@ void KDEXLib::setupEventLoop()
}
#endif
#endif
-#ifdef QT_UNIX_EVENT_LOOP_SUPPORT
+#if QT_UNIX_EVENT_LOOP_SUPPORT
// When Qt does not use Glib support, it uses its own Unix event dispatcher.
// That one has aboutToBlock() and awake() signals, but they are broken (either
// functionality or semantics), as e.g. awake() is not emitted right after the dispatcher
@@ -239,7 +243,7 @@ void KDEXLib::setupEventLoop()
#endif
}
-#ifdef GLIB_EVENT_LOOP_SUPPORT
+#if GLIB_EVENT_LOOP_SUPPORT
gint gpoll_wrapper( GPollFD* ufds, guint nfds, gint timeout )
{
SalYieldMutexReleaser release; // release YieldMutex (and re-acquire at block end)
@@ -247,7 +251,7 @@ gint gpoll_wrapper( GPollFD* ufds, guint nfds, gint timeout )
}
#endif
-#ifdef QT_UNIX_EVENT_LOOP_SUPPORT
+#if QT_UNIX_EVENT_LOOP_SUPPORT
int lo_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
const struct timeval *orig_timeout)
{