diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-11-10 09:48:11 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-11-10 09:48:11 (GMT) |
commit | d845505fd57ad4b06499b5b125703e80bbae692a (patch) | |
tree | 90f7f0d55eec7754fe870a62b117ac8be6e250d1 | |
parent | 327ef9127aba3aa6bf2238c0aa779613f8edf0b1 (diff) | |
download | Qt-d845505fd57ad4b06499b5b125703e80bbae692a.zip Qt-d845505fd57ad4b06499b5b125703e80bbae692a.tar.gz Qt-d845505fd57ad4b06499b5b125703e80bbae692a.tar.bz2 |
Avoid XSync-related runtime crashes on HP-UX due to C++ mangling.
HP-UX is missing the extern "C" wrapper for its XSync function
declarations. This caused applications to _build_ but not _run_ (i.e.,
all GUI apps crashed). Adding the wrapper should be harmless on all
X11 platforms.
Task-number: QTBUG-5524
Reviewed-by: Thiago
-rw-r--r-- | config.tests/x11/xsync/xsync.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qt_x11_p.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/config.tests/x11/xsync/xsync.cpp b/config.tests/x11/xsync/xsync.cpp index a7175de..8eea850 100644 --- a/config.tests/x11/xsync/xsync.cpp +++ b/config.tests/x11/xsync/xsync.cpp @@ -41,12 +41,16 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> +extern "C" { #include <X11/extensions/sync.h> +} int main(int, char **) { XSyncValue value; (void*)&XSyncIntToValue; (void*)&XSyncCreateCounter; - return 0; + int a, b; + Status ret = XSyncInitialize(NULL, &a, &b); + return ret; } diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index 9f08dc6..9e4cf60 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -163,7 +163,9 @@ extern "C" { #endif // QT_NO_XRENDER #ifndef QT_NO_XSYNC +extern "C" { # include "X11/extensions/sync.h" +} #endif // #define QT_NO_XKB |