diff -ur qt-everywhere-opensource-src-4.7.3/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp --- qt-everywhere-opensource-src-4.7.3/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp 2010-11-06 12:55:22.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp 2010-12-29 20:11:12.000000000 +1100 @@ -70,6 +70,10 @@ #endif #include +#if defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41) +#include +#endif + #if OS(SOLARIS) #include #else @@ -646,11 +650,22 @@ static pthread_t stackThread; pthread_t thread = pthread_self(); if (stackBase == 0 || thread != stackThread) { +#if defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41) + // LSB versions before 4.1 are missing pthread_getattr_np - resolve it once at runtime instead + // see http://bugs.linuxbase.org/show_bug.cgi?id=2364 + typedef int (*GetAttrPtr)(pthread_t, pthread_attr_t *); + static int (*pthread_getattr_np_ptr)(pthread_t, pthread_attr_t *) = 0; + if (!pthread_getattr_np_ptr) + *(void **)&pthread_getattr_np_ptr = dlsym(RTLD_DEFAULT, "pthread_getattr_np"); +#endif pthread_attr_t sattr; pthread_attr_init(&sattr); #if HAVE(PTHREAD_NP_H) || OS(NETBSD) // e.g. on FreeBSD 5.4, neundorf@kde.org pthread_attr_get_np(thread, &sattr); +#elif defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41) + if (pthread_getattr_np_ptr) + pthread_getattr_np_ptr(thread, &sattr); #else // FIXME: this function is non-portable; other POSIX systems may have different np alternatives pthread_getattr_np(thread, &sattr); diff -ur qt-everywhere-opensource-src-4.7.3/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h --- qt-everywhere-opensource-src-4.7.3/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h 2010-11-06 12:55:19.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h 2011-01-06 14:23:29.000000000 +1100 @@ -688,8 +688,10 @@ && !OS(ANDROID) && !PLATFORM(BREWMP) #define HAVE_TM_GMTOFF 1 #define HAVE_TM_ZONE 1 +#if !defined(__LSB_VERSION__) #define HAVE_TIMEGM 1 #endif +#endif #if OS(DARWIN) diff -ur qt-everywhere-opensource-src-4.7.3/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h --- qt-everywhere-opensource-src-4.7.3/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h 2010-11-06 12:55:22.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h 2011-01-06 14:23:55.000000000 +1100 @@ -693,8 +693,10 @@ && !OS(ANDROID) && !OS(AIX) && !OS(HPUX) #define HAVE_TM_GMTOFF 1 #define HAVE_TM_ZONE 1 +#if !defined(__LSB_VERSION__) #define HAVE_TIMEGM 1 #endif +#endif #if OS(DARWIN) diff -ur qt-everywhere-opensource-src-4.7.3/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h --- qt-everywhere-opensource-src-4.7.3/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h 2010-11-06 12:55:22.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h 2010-12-29 18:52:40.000000000 +1100 @@ -76,7 +76,7 @@ #elif OS(ANDROID) #include #elif COMPILER(GCC) && !OS(SYMBIAN) -#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) +#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))) && !defined(__LSB_VERSION__) #include #else #include diff -ur qt-everywhere-opensource-src-4.7.3/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp --- qt-everywhere-opensource-src-4.7.3/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp 2010-11-06 12:55:19.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp 2010-12-29 20:10:11.000000000 +1100 @@ -70,6 +70,10 @@ #endif #include +#if defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41) +#include +#endif + #if OS(SOLARIS) #include #else @@ -587,11 +591,22 @@ static pthread_t stackThread; pthread_t thread = pthread_self(); if (stackBase == 0 || thread != stackThread) { +#if defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41) + // LSB versions before 4.1 are missing pthread_getattr_np - resolve it once at runtime instead + // see http://bugs.linuxbase.org/show_bug.cgi?id=2364 + typedef int (*GetAttrPtr)(pthread_t, pthread_attr_t *); + static int (*pthread_getattr_np_ptr)(pthread_t, pthread_attr_t *) = 0; + if (!pthread_getattr_np_ptr) + *(void **)&pthread_getattr_np_ptr = dlsym(RTLD_DEFAULT, "pthread_getattr_np"); +#endif pthread_attr_t sattr; pthread_attr_init(&sattr); #if HAVE(PTHREAD_NP_H) || OS(NETBSD) // e.g. on FreeBSD 5.4, neundorf@kde.org pthread_attr_get_np(thread, &sattr); +#elif defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41) + if (pthread_getattr_np_ptr) + pthread_getattr_np_ptr(thread, &sattr); #else // FIXME: this function is non-portable; other POSIX systems may have different np alternatives pthread_getattr_np(thread, &sattr); diff -ur qt-everywhere-opensource-src-4.7.3/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h --- qt-everywhere-opensource-src-4.7.3/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h 2010-11-06 12:55:20.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h 2010-12-29 18:53:01.000000000 +1100 @@ -76,7 +76,7 @@ #elif OS(ANDROID) #include #elif COMPILER(GCC) && !OS(SYMBIAN) -#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) +#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))) && !defined(__LSB_VERSION__) #include #else #include diff -ur qt-everywhere-opensource-src-4.7.3/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro --- qt-everywhere-opensource-src-4.7.3/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro 2010-11-06 12:55:20.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro 2010-12-29 21:35:49.000000000 +1100 @@ -35,7 +35,7 @@ include(../../../WebKit.pri) -QT += declarative +QT += declarative script xmlpatterns !CONFIG(standalone_package) { linux-* { diff -ur qt-everywhere-opensource-src-4.7.3/src/gui/text/qfontengine_ft.cpp qt-everywhere-opensource-src-4.7.3-patched/src/gui/text/qfontengine_ft.cpp --- qt-everywhere-opensource-src-4.7.3/src/gui/text/qfontengine_ft.cpp 2010-11-06 12:55:15.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/gui/text/qfontengine_ft.cpp 2010-12-29 22:44:53.000000000 +1100 @@ -94,7 +94,7 @@ #endif /* FreeType 2.1.10 starts to provide FT_GlyphSlot_Embolden */ -#if (FREETYPE_MAJOR*10000+FREETYPE_MINOR*100+FREETYPE_PATCH) >= 20110 +#if (FREETYPE_MAJOR*10000+FREETYPE_MINOR*100+FREETYPE_PATCH) >= 20110 && !defined(__LSB_VERSION__) #define Q_FT_GLYPHSLOT_EMBOLDEN(slot) FT_GlyphSlot_Embolden(slot) #else #define Q_FT_GLYPHSLOT_EMBOLDEN(slot) diff -ur qt-everywhere-opensource-src-4.7.3/src/imports/folderlistmodel/folderlistmodel.pro qt-everywhere-opensource-src-4.7.3-patched/src/imports/folderlistmodel/folderlistmodel.pro --- qt-everywhere-opensource-src-4.7.3/src/imports/folderlistmodel/folderlistmodel.pro 2010-11-06 12:55:18.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/imports/folderlistmodel/folderlistmodel.pro 2010-12-29 21:25:33.000000000 +1100 @@ -2,7 +2,7 @@ TARGETPATH = Qt/labs/folderlistmodel include(../qimportbase.pri) -QT += declarative script +QT += declarative script xmlpatterns SOURCES += qdeclarativefolderlistmodel.cpp plugin.cpp HEADERS += qdeclarativefolderlistmodel.h diff -ur qt-everywhere-opensource-src-4.7.3/src/imports/gestures/gestures.pro qt-everywhere-opensource-src-4.7.3-patched/src/imports/gestures/gestures.pro --- qt-everywhere-opensource-src-4.7.3/src/imports/gestures/gestures.pro 2010-11-06 12:55:18.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/imports/gestures/gestures.pro 2010-12-29 21:28:22.000000000 +1100 @@ -2,7 +2,7 @@ TARGETPATH = Qt/labs/gestures include(../qimportbase.pri) -QT += declarative +QT += declarative script xmlpatterns SOURCES += qdeclarativegesturearea.cpp plugin.cpp HEADERS += qdeclarativegesturearea_p.h diff -ur qt-everywhere-opensource-src-4.7.3/src/imports/particles/particles.pro qt-everywhere-opensource-src-4.7.3-patched/src/imports/particles/particles.pro --- qt-everywhere-opensource-src-4.7.3/src/imports/particles/particles.pro 2010-11-06 12:55:18.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/imports/particles/particles.pro 2010-12-29 21:26:17.000000000 +1100 @@ -2,7 +2,7 @@ TARGETPATH = Qt/labs/particles include(../qimportbase.pri) -QT += declarative +QT += declarative script xmlpatterns SOURCES += \ qdeclarativeparticles.cpp \ diff -ur qt-everywhere-opensource-src-4.7.3/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro qt-everywhere-opensource-src-4.7.3-patched/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro --- qt-everywhere-opensource-src-4.7.3/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro 2010-12-31 17:56:16.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/tools/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro 2010-11-06 12:55:12.000000000 +1100 @@ -1,7 +1,7 @@ TEMPLATE = lib TARGET = qdeclarativeview CONFIG += qt warn_on plugin designer -QT += declarative +QT += declarative script xmlpatterns include(../plugins.pri) build_all:!build_pass { diff -ur qt-everywhere-opensource-src-4.7.3/tools/qml/qml.pri qt-everywhere-opensource-src-4.7.3-patched/tools/qml/qml.pri --- qt-everywhere-opensource-src-4.7.3/tools/qml/qml.pri 2010-11-06 12:55:12.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/tools/qml/qml.pri 2010-12-31 19:58:52.000000000 +1100 @@ -1,4 +1,4 @@ -QT += declarative script network sql +QT += declarative script network sql xmlpatterns contains(QT_CONFIG, opengl) { QT += opengl DEFINES += GL_SUPPORTED diff -ur qt-everywhere-opensource-src-4.7.3/src/gui/kernel/qt_x11_p.h qt-everywhere-opensource-src-4.7.3-patched/src/gui/kernel/qt_x11_p.h --- qt-everywhere-opensource-src-4.7.3/src/gui/kernel/qt_x11_p.h 2010-11-06 12:55:17.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/gui/kernel/qt_x11_p.h 2011-01-03 22:20:55.000000000 +1100 @@ -60,6 +60,17 @@ // the following is necessary to work around breakage in many versions // of XFree86's Xlib.h still in use // ### which versions? +// NOTE: This issue has been reported against the latest LSB packages (LSB 4.1 beta). +// For details, see http://bugs.linuxbase.org/show_bug.cgi?id=3145 +// The prevalent implementations of XRegisterIMInstantiateCallback and +// XUnregisterIMInstantiateCallback are actually consistent with the +// function prototypes that LSB's Xlib.h defines, even though this is +// inconsistent with the Xlib specification. We therefore must keep +// the LSB-defined function prototypes or else client code will pass +// invalid data to the fifth and sixth parameters of these two functions. +#if defined(__LSB_VERSION__) +#include +#else #if defined(_XLIB_H_) // crude hack, but... #error "cannot include before this file" #endif @@ -70,6 +81,7 @@ #undef XRegisterIMInstantiateCallback #undef XUnregisterIMInstantiateCallback #undef XSetIMValues +#endif #include #include @@ -253,6 +265,8 @@ //######### Many old X11R6 header files lack XSetIMValues. //######### Therefore, we have to declare these functions ourselves. +// NOTE: LSB versions need to be kept as they are. See comments near top of this file. +#if !defined(__LSB_VERSION__) extern "C" Bool XRegisterIMInstantiateCallback( Display*, struct _XrmHashBucketRec*, @@ -272,7 +286,7 @@ ); extern "C" char *XSetIMValues(XIM /* im */, ...); - +#endif // __LSB_VERSION__ #endif #ifndef QT_NO_FONTCONFIG diff -ur qt-everywhere-opensource-src-4.7.3/src/gui/kernel/qapplication_p.h qt-everywhere-opensource-src-4.7.3-patched/src/gui/kernel/qapplication_p.h --- qt-everywhere-opensource-src-4.7.3/src/gui/kernel/qapplication_p.h 2010-11-06 12:55:17.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/gui/kernel/qapplication_p.h 2011-01-04 15:25:38.000000000 +1100 @@ -540,7 +540,18 @@ #if defined(Q_WS_WIN) QPixmap *ignore_cursor; #endif + +// CursorShape is defined in X11/X.h +#ifdef CursorShape +#ifndef X_CursorShape +#define X_CursorShape 0 // This value is defined in LSB +#endif +#undef CursorShape +#endif QPixmap getPixmapCursor(Qt::CursorShape cshape); +#ifdef X_CursorShape +#define CursorShape X_CursorShape +#endif QMap > widgetForTouchPointId; QMap appCurrentTouchPoints; diff -ru qt-everywhere-opensource-src-4.7.3/src/corelib/io/qtextstream.h qt-everywhere-opensource-src-4.7.3-patched/src/corelib/io/qtextstream.h --- qt-everywhere-opensource-src-4.7.3/src/corelib/io/qtextstream.h 2010-11-06 12:55:18.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/corelib/io/qtextstream.h 2011-01-03 13:42:05.000000000 +1100 @@ -56,7 +56,14 @@ #include +#if defined(__LSB_VERSION__) +// The X11/Xlib.h LSB header defines Status as an int, but +// we need to undefine that here since we (unfortunately) +// re-use that symbol name within QTextStream as an enum type. #ifdef Status +#undef Status +#endif +#elif defined(Status) #error qtextstream.h must be included before any header file that defines Status #endif @@ -373,4 +380,9 @@ QT_END_HEADER +// Ensure we put back the definition of Status if we removed it +#if defined(__LSB_VERSION__) && defined(_X11_XLIB_H_) +#define Status int +#endif + #endif // QTEXTSTREAM_H diff -ur qt-everywhere-opensource-src-4.7.3/src/corelib/io/qurl.h qt-everywhere-opensource-src-4.7.3-patched/src/corelib/io/qurl.h --- qt-everywhere-opensource-src-4.7.3/src/corelib/io/qurl.h 2010-11-06 12:55:18.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/corelib/io/qurl.h 2011-01-04 16:52:56.000000000 +1100 @@ -65,6 +65,13 @@ StrictMode }; +// None is defined in X11/X.h +#ifdef None +#if !defined(X_None) +#define X_None 0L // This value is defined in both the LSB and Xlib specs +#endif +#undef None +#endif // encoding / toString values enum FormattingOption { None = 0x0, @@ -81,6 +88,9 @@ StripTrailingSlash = 0x10000 }; Q_DECLARE_FLAGS(FormattingOptions, FormattingOption) +#if defined(X_None) +#define None X_None +#endif QUrl(); #ifdef QT_NO_URL_CAST_FROM_STRING diff -ur qt-everywhere-opensource-src-4.7.3/src/gui/inputmethod/qximinputcontext_x11.cpp qt-everywhere-opensource-src-4.7.3-patched/src/gui/inputmethod/qximinputcontext_x11.cpp --- qt-everywhere-opensource-src-4.7.3/src/gui/inputmethod/qximinputcontext_x11.cpp 2010-11-06 12:55:14.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/gui/inputmethod/qximinputcontext_x11.cpp 2011-01-04 18:05:39.000000000 +1100 @@ -101,7 +101,7 @@ extern "C" { #ifdef USE_X11R6_XIM - static void xim_create_callback(XIM /*im*/, + static void xim_create_callback(XID /*id*/, XPointer client_data, XPointer /*call_data*/) { @@ -118,7 +118,7 @@ // qDebug("xim_destroy_callback"); qic->close_xim(); XRegisterIMInstantiateCallback(X11->display, 0, 0, 0, - (XIMProc) xim_create_callback, reinterpret_cast(qic)); + (XIDProc) xim_create_callback, reinterpret_cast(qic)); } #endif // USE_X11R6_XIM @@ -371,7 +371,7 @@ qWarning("Qt: Cannot set locale modifiers: %s", ximServerName.constData()); else XRegisterIMInstantiateCallback(X11->display, 0, 0, 0, - (XIMProc) xim_create_callback, reinterpret_cast(this)); + (XIDProc) xim_create_callback, reinterpret_cast(this)); #else // !USE_X11R6_XIM else if (XSetLocaleModifiers ("") == 0) qWarning("Qt: Cannot set locale modifiers"); @@ -475,7 +475,7 @@ #ifdef USE_X11R6_XIM XUnregisterIMInstantiateCallback(X11->display, 0, 0, 0, - (XIMProc) xim_create_callback, reinterpret_cast(this)); + (XIDProc) xim_create_callback, reinterpret_cast(this)); #endif // USE_X11R6_XIM if (QWidget *focusWidget = QApplication::focusWidget()) { diff -ur qt-everywhere-opensource-src-4.7.3/src/qt3support/network/q3dns.cpp qt-everywhere-opensource-src-4.7.3-patched/src/qt3support/network/q3dns.cpp --- qt-everywhere-opensource-src-4.7.3/src/qt3support/network/q3dns.cpp 2010-11-06 12:55:17.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/qt3support/network/q3dns.cpp 2011-01-18 20:25:34.000000000 +1100 @@ -2484,6 +2484,7 @@ } } +#if !defined(__LSB_VERSION__) if (theNs->isEmpty()) { #if defined(Q_MODERN_RES_API) struct __res_state res; @@ -2530,6 +2531,7 @@ theNs->next(); } } +#endif QFile hosts( QString::fromLatin1( "/etc/hosts" ) ); if ( hosts.open( QIODevice::ReadOnly ) ) { diff -ur qt-everywhere-opensource-src-4.7.3/src/plugins/qmltooling/tcpserver/tcpserver.pro qt-everywhere-opensource-src-4.7.3-patched/src/plugins/qmltooling/tcpserver/tcpserver.pro --- qt-everywhere-opensource-src-4.7.3/src/plugins/qmltooling/tcpserver/tcpserver.pro 2011-03-30 16:19:09.000000000 +1100 +++ qt-everywhere-opensource-src-4.7.3-patched/src/plugins/qmltooling/tcpserver/tcpserver.pro 2011-05-07 23:35:10.000000000 +1000 @@ -1,5 +1,5 @@ TARGET = tcpserver -QT += declarative network +QT += declarative network script xmlpatterns include(../../qpluginbase.pri) diff -ur qt-everywhere-opensource-src-4.7.3/src/network/kernel/qnetworkinterface_unix.cpp qt-everywhere-opensource-src-4.7.3-patched/src/network/kernel/qnetworkinterface_unix.cpp --- qt-everywhere-opensource-src-4.7.3/src/network/kernel/qnetworkinterface_unix.cpp +++ qt-everywhere-opensource-src-4.7.3-patched/src/network/kernel/qnetworkinterface_unix.cpp @@ -219,7 +219,7 @@ #ifdef SIOCGIFHWADDR // Get the HW address if (qt_safe_ioctl(socket, SIOCGIFHWADDR, &req) >= 0) { - uchar *addr = (uchar *)&req.ifr_addr; + uchar *addr = (uchar *)req.ifr_addr.sa_data; iface->hardwareAddress = iface->makeHwAddress(6, addr); } #endif