From 3a63bb0ea755bb15c03a82192773c481d5ae8574 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Jul 2015 10:40:29 -0700 Subject: Let the linker find xcb_poll_for_queued_event for us It's more efficient than we are. This also enables the code to work in the unlikely case of an ELF platform without RTLD_DEFAULT. Change-Id: Ib306f8f647014b399b87ffff13f12f8aeeb2589a Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbconnection.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 2158300591..d2e08aecee 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -55,7 +55,6 @@ #include -#include #include #include #include @@ -77,6 +76,14 @@ #include #endif +#if defined(Q_CC_GNU) && defined(Q_OF_ELF) +static xcb_generic_event_t *local_xcb_poll_for_queued_event(xcb_connection_t *c) + __attribute__((weakref("xcb_poll_for_queued_event"))); + +static inline void checkXcbPollForQueuedEvent() +{ } +#else +#include typedef xcb_generic_event_t * (*XcbPollForQueuedEventFunctionPointer)(xcb_connection_t *c); static XcbPollForQueuedEventFunctionPointer local_xcb_poll_for_queued_event; @@ -85,12 +92,8 @@ static inline void checkXcbPollForQueuedEvent() #ifdef RTLD_DEFAULT local_xcb_poll_for_queued_event = (XcbPollForQueuedEventFunctionPointer)dlsym(RTLD_DEFAULT, "xcb_poll_for_queued_event"); #endif - -#ifdef Q_XCB_DEBUG - if (local_xcb_poll_for_queued_event) - qDebug("Using threaded event reader with xcb_poll_for_queued_event"); -#endif } +#endif QT_BEGIN_NAMESPACE -- cgit v1.2.3