From d1b4857d1718ef50dba64c8700253fed5d187ab2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 10 Mar 2013 13:34:52 -0700 Subject: Make sure that we #include qconfig.h before testing for features. This is mandatory in public headers (qiodevice.h, qopengl*, etc.), but it's a good idea even in private headers, in case someone includes that header first somewhere. In particular, all platformsupport API is private. Change-Id: If287baa5d9ed14e93c1666efa0e6332c4c1cd9a4 Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qiodevice.h | 1 + src/corelib/kernel/qfunctions_nacl.h | 2 ++ src/corelib/kernel/qfunctions_vxworks.h | 3 +++ src/corelib/kernel/qfunctions_wince.h | 3 +++ src/corelib/kernel/qtimer.h | 2 ++ src/corelib/tools/qregexp.h | 2 ++ src/corelib/tools/qregularexpression.h | 2 ++ src/gui/accessible/qaccessible.h | 2 ++ src/gui/image/qiconloader_p.h | 2 ++ src/gui/kernel/qopenglcontext.h | 2 ++ src/gui/kernel/qplatformopenglcontext.h | 3 ++- src/gui/opengl/qopengl.h | 4 ++-- src/gui/opengl/qopenglbuffer.h | 2 ++ src/gui/opengl/qopenglframebufferobject.h | 2 ++ src/gui/opengl/qopenglfunctions.h | 2 ++ src/gui/opengl/qopenglpaintdevice.h | 2 ++ src/gui/opengl/qopenglshaderprogram.h | 2 ++ src/gui/opengl/qopenglversionfunctions.h | 3 ++- src/gui/text/qtextodfwriter_p.h | 3 +++ src/gui/text/qzipreader_p.h | 2 ++ src/gui/text/qzipwriter_p.h | 3 +++ src/openglextensions/qopenglextensions.h | 3 ++- .../fontdatabases/genericunix/qgenericunixfontdatabase_p.h | 2 ++ src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h | 1 + src/plugins/platforms/cocoa/qcocoasystemtrayicon.h | 2 ++ src/plugins/platforms/cocoa/qprintengine_mac_p.h | 2 ++ src/plugins/platforms/qnx/qqnxclipboard.h | 2 ++ src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h | 2 ++ src/printsupport/kernel/qpaintengine_alpha_p.h | 2 ++ src/printsupport/kernel/qprintengine_win_p.h | 2 ++ src/sql/drivers/db2/qsql_db2_p.h | 2 ++ src/testlib/qtestaccessible.h | 2 ++ src/widgets/dialogs/qfiledialog_p.h | 2 ++ src/widgets/dialogs/qwizard_win_p.h | 2 ++ src/widgets/kernel/qwidgetsfunctions_wince.h | 3 +++ src/widgets/styles/qcommonstylepixmaps_p.h | 2 ++ src/widgets/widgets/qscrollarea_p.h | 2 ++ 37 files changed, 77 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h index 39c2d70492..cdc90f21bb 100644 --- a/src/corelib/io/qiodevice.h +++ b/src/corelib/io/qiodevice.h @@ -42,6 +42,7 @@ #ifndef QIODEVICE_H #define QIODEVICE_H +#include #ifndef QT_NO_QOBJECT #include #else diff --git a/src/corelib/kernel/qfunctions_nacl.h b/src/corelib/kernel/qfunctions_nacl.h index f40807a0d9..c15b9756d0 100644 --- a/src/corelib/kernel/qfunctions_nacl.h +++ b/src/corelib/kernel/qfunctions_nacl.h @@ -42,6 +42,8 @@ #ifndef QFUNCTIONS_NACL_H #define QFUNCTIONS_NACL_H +#include + #ifdef Q_OS_NACL #include diff --git a/src/corelib/kernel/qfunctions_vxworks.h b/src/corelib/kernel/qfunctions_vxworks.h index 02c599f490..e33401a86a 100644 --- a/src/corelib/kernel/qfunctions_vxworks.h +++ b/src/corelib/kernel/qfunctions_vxworks.h @@ -41,6 +41,9 @@ #ifndef QFUNCTIONS_VXWORKS_H #define QFUNCTIONS_VXWORKS_H + +#include + #ifdef Q_OS_VXWORKS #include diff --git a/src/corelib/kernel/qfunctions_wince.h b/src/corelib/kernel/qfunctions_wince.h index 4eeb9cff6a..ab7bbe3f99 100644 --- a/src/corelib/kernel/qfunctions_wince.h +++ b/src/corelib/kernel/qfunctions_wince.h @@ -41,6 +41,9 @@ #ifndef QFUNCTIONS_WINCE_H #define QFUNCTIONS_WINCE_H + +#include + #ifdef Q_OS_WINCE #include #include diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index 34bfff9089..3484f4dba8 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -42,6 +42,8 @@ #ifndef QTIMER_H #define QTIMER_H +#include + #ifndef QT_NO_QOBJECT #include // conceptual inheritance diff --git a/src/corelib/tools/qregexp.h b/src/corelib/tools/qregexp.h index acf59d7196..26b0b78317 100644 --- a/src/corelib/tools/qregexp.h +++ b/src/corelib/tools/qregexp.h @@ -42,6 +42,8 @@ #ifndef QREGEXP_H #define QREGEXP_H +#include + #ifndef QT_NO_REGEXP #include diff --git a/src/corelib/tools/qregularexpression.h b/src/corelib/tools/qregularexpression.h index 97dbee9256..5059ea6431 100644 --- a/src/corelib/tools/qregularexpression.h +++ b/src/corelib/tools/qregularexpression.h @@ -43,6 +43,8 @@ #ifndef QREGULAREXPRESSION_H #define QREGULAREXPRESSION_H +#include + #ifndef QT_NO_REGULAREXPRESSION #include diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index 96fc7c031b..09e259c1d0 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -39,6 +39,8 @@ ** ****************************************************************************/ +#include + #ifndef QT_NO_ACCESSIBILITY #ifndef QACCESSIBLE_H #define QACCESSIBLE_H diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h index ea144ec299..419d93d576 100644 --- a/src/gui/image/qiconloader_p.h +++ b/src/gui/image/qiconloader_p.h @@ -42,6 +42,8 @@ #ifndef QICONLOADER_P_H #define QICONLOADER_P_H +#include + #ifndef QT_NO_ICON // // W A R N I N G diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index 52b4a2da28..419fd541eb 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -42,6 +42,8 @@ #ifndef QOPENGLCONTEXT_H #define QOPENGLCONTEXT_H +#include + #ifndef QT_NO_OPENGL #include diff --git a/src/gui/kernel/qplatformopenglcontext.h b/src/gui/kernel/qplatformopenglcontext.h index 9e13622283..42e4db2f9d 100644 --- a/src/gui/kernel/qplatformopenglcontext.h +++ b/src/gui/kernel/qplatformopenglcontext.h @@ -51,9 +51,10 @@ // source and binary incompatible with future versions of Qt. // +#include + #ifndef QT_NO_OPENGL -#include #include #include #include diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h index c5bff90d2a..6e8be66806 100644 --- a/src/gui/opengl/qopengl.h +++ b/src/gui/opengl/qopengl.h @@ -42,10 +42,10 @@ #ifndef QOPENGL_H #define QOPENGL_H -#ifndef QT_NO_OPENGL - #include +#ifndef QT_NO_OPENGL + // Windows always needs this to ensure that APIENTRY gets defined #if defined(Q_OS_WIN) # include diff --git a/src/gui/opengl/qopenglbuffer.h b/src/gui/opengl/qopenglbuffer.h index 014060086d..ab564e9001 100644 --- a/src/gui/opengl/qopenglbuffer.h +++ b/src/gui/opengl/qopenglbuffer.h @@ -42,6 +42,8 @@ #ifndef QOPENGLBUFFER_H #define QOPENGLBUFFER_H +#include + #ifndef QT_NO_OPENGL #include diff --git a/src/gui/opengl/qopenglframebufferobject.h b/src/gui/opengl/qopenglframebufferobject.h index e4fd7c8e95..215d3701ca 100644 --- a/src/gui/opengl/qopenglframebufferobject.h +++ b/src/gui/opengl/qopenglframebufferobject.h @@ -42,6 +42,8 @@ #ifndef QOPENGLFRAMEBUFFEROBJECT_H #define QOPENGLFRAMEBUFFEROBJECT_H +#include + #ifndef QT_NO_OPENGL #include diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h index 7d88f8b08b..1548ad4a24 100644 --- a/src/gui/opengl/qopenglfunctions.h +++ b/src/gui/opengl/qopenglfunctions.h @@ -42,6 +42,8 @@ #ifndef QOPENGLFUNCTIONS_H #define QOPENGLFUNCTIONS_H +#include + #ifndef QT_NO_OPENGL #ifdef __GLEW_H__ diff --git a/src/gui/opengl/qopenglpaintdevice.h b/src/gui/opengl/qopenglpaintdevice.h index 5868a5740a..c05571c928 100644 --- a/src/gui/opengl/qopenglpaintdevice.h +++ b/src/gui/opengl/qopenglpaintdevice.h @@ -42,6 +42,8 @@ #ifndef QOPENGLPAINTDEVICE_H #define QOPENGLPAINTDEVICE_H +#include + #ifndef QT_NO_OPENGL #include diff --git a/src/gui/opengl/qopenglshaderprogram.h b/src/gui/opengl/qopenglshaderprogram.h index 6c3dd37843..b894ae3af8 100644 --- a/src/gui/opengl/qopenglshaderprogram.h +++ b/src/gui/opengl/qopenglshaderprogram.h @@ -42,6 +42,8 @@ #ifndef QOPENGLSHADERPROGRAM_H #define QOPENGLSHADERPROGRAM_H +#include + #ifndef QT_NO_OPENGL #include diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h index 474a5d5d1f..b58a7186d1 100644 --- a/src/gui/opengl/qopenglversionfunctions.h +++ b/src/gui/opengl/qopenglversionfunctions.h @@ -51,9 +51,10 @@ #ifndef QOPENGLVERSIONFUNCTIONS_H #define QOPENGLVERSIONFUNCTIONS_H +#include + #ifndef QT_NO_OPENGL -#include #include #include #include diff --git a/src/gui/text/qtextodfwriter_p.h b/src/gui/text/qtextodfwriter_p.h index cbdc5fbb95..6683e1eed9 100644 --- a/src/gui/text/qtextodfwriter_p.h +++ b/src/gui/text/qtextodfwriter_p.h @@ -41,6 +41,9 @@ #ifndef QTEXTODFWRITER_H #define QTEXTODFWRITER_H + +#include + #ifndef QT_NO_TEXTODFWRITER // diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h index a784d7d9ea..b641689e47 100644 --- a/src/gui/text/qzipreader_p.h +++ b/src/gui/text/qzipreader_p.h @@ -42,6 +42,8 @@ #ifndef QZIPREADER_H #define QZIPREADER_H +#include + #ifndef QT_NO_TEXTODFWRITER // diff --git a/src/gui/text/qzipwriter_p.h b/src/gui/text/qzipwriter_p.h index 1246da5a05..e6a19e22e4 100644 --- a/src/gui/text/qzipwriter_p.h +++ b/src/gui/text/qzipwriter_p.h @@ -40,6 +40,9 @@ ****************************************************************************/ #ifndef QZIPWRITER_H #define QZIPWRITER_H + +#include + #ifndef QT_NO_TEXTODFWRITER // diff --git a/src/openglextensions/qopenglextensions.h b/src/openglextensions/qopenglextensions.h index 0e9e2c60d4..7d6c21e4e5 100644 --- a/src/openglextensions/qopenglextensions.h +++ b/src/openglextensions/qopenglextensions.h @@ -51,9 +51,10 @@ #ifndef QOPENGLEXTENSIONS_H #define QOPENGLEXTENSIONS_H +#include + #ifndef QT_NO_OPENGL -#include #include class QOpenGLContext; diff --git a/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h b/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h index 1995ead657..a8a0b8fe9c 100644 --- a/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/genericunix/qgenericunixfontdatabase_p.h @@ -42,6 +42,8 @@ #ifndef QGENERICUNIXFONTDATABASE_H #define QGENERICUNIXFONTDATABASE_H +#include + #ifdef Q_FONTCONFIGDATABASE #include typedef QFontconfigDatabase QGenericUnixFontDatabase; diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h index 7ebe7a4e9d..3b1fbe042d 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h @@ -41,6 +41,7 @@ #ifndef QCOCOAACCESIBILITYELEMENT_H #define QCOCOAACCESIBILITYELEMENT_H +#include #import #import diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h index 89ab51cf05..61a6ba3e2f 100755 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h +++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h @@ -43,6 +43,8 @@ #ifndef QCOCOASYSTEMTRAYICON_P_H #define QCOCOASYSTEMTRAYICON_P_H +#include + #ifndef QT_NO_SYSTEMTRAYICON #include "QtCore/qstring.h" diff --git a/src/plugins/platforms/cocoa/qprintengine_mac_p.h b/src/plugins/platforms/cocoa/qprintengine_mac_p.h index fd1b60a9ad..28183118d8 100644 --- a/src/plugins/platforms/cocoa/qprintengine_mac_p.h +++ b/src/plugins/platforms/cocoa/qprintengine_mac_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #ifndef QT_NO_PRINTER #include diff --git a/src/plugins/platforms/qnx/qqnxclipboard.h b/src/plugins/platforms/qnx/qqnxclipboard.h index 0b75393efd..e069355adc 100644 --- a/src/plugins/platforms/qnx/qqnxclipboard.h +++ b/src/plugins/platforms/qnx/qqnxclipboard.h @@ -42,6 +42,8 @@ #ifndef QQNXCLIPBOARD_H #define QQNXCLIPBOARD_H +#include + #ifndef QT_NO_CLIPBOARD #include diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h index 35ed6f3891..106087f757 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h @@ -42,6 +42,8 @@ #ifndef QWINDOWSFONTENGINEDIRECTWRITE_H #define QWINDOWSFONTENGINEDIRECTWRITE_H +#include + #ifndef QT_NO_DIRECTWRITE #include diff --git a/src/printsupport/kernel/qpaintengine_alpha_p.h b/src/printsupport/kernel/qpaintengine_alpha_p.h index 99b9b930e9..8a0781d0d3 100644 --- a/src/printsupport/kernel/qpaintengine_alpha_p.h +++ b/src/printsupport/kernel/qpaintengine_alpha_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #ifndef QT_NO_PRINTER #include "private/qpaintengine_p.h" #include diff --git a/src/printsupport/kernel/qprintengine_win_p.h b/src/printsupport/kernel/qprintengine_win_p.h index ffeebb0704..93fe993088 100644 --- a/src/printsupport/kernel/qprintengine_win_p.h +++ b/src/printsupport/kernel/qprintengine_win_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #ifndef QT_NO_PRINTER #include diff --git a/src/sql/drivers/db2/qsql_db2_p.h b/src/sql/drivers/db2/qsql_db2_p.h index 6a5363740b..68563448ed 100644 --- a/src/sql/drivers/db2/qsql_db2_p.h +++ b/src/sql/drivers/db2/qsql_db2_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #ifdef QT_PLUGIN #define Q_EXPORT_SQLDRIVER_DB2 #else diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h index 24fc1d7991..f27651c3ad 100644 --- a/src/testlib/qtestaccessible.h +++ b/src/testlib/qtestaccessible.h @@ -47,6 +47,8 @@ #pragma qt_no_master_include #endif +#include + #ifndef QT_NO_ACCESSIBILITY #define QVERIFY_EVENT(event) \ diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h index ffaa2bc6f8..4292df5890 100644 --- a/src/widgets/dialogs/qfiledialog_p.h +++ b/src/widgets/dialogs/qfiledialog_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #ifndef QT_NO_FILEDIALOG #include "qfiledialog.h" diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h index badaab52d9..542f59e1b2 100644 --- a/src/widgets/dialogs/qwizard_win_p.h +++ b/src/widgets/dialogs/qwizard_win_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #ifndef QT_NO_WIZARD #ifndef QT_NO_STYLE_WINDOWSVISTA diff --git a/src/widgets/kernel/qwidgetsfunctions_wince.h b/src/widgets/kernel/qwidgetsfunctions_wince.h index cc8c1e4a03..ca742e296a 100644 --- a/src/widgets/kernel/qwidgetsfunctions_wince.h +++ b/src/widgets/kernel/qwidgetsfunctions_wince.h @@ -40,6 +40,9 @@ ****************************************************************************/ #ifndef QWIDGETSFUNCTIONS_WCE_H #define QWIDGETSFUNCTIONS_WCE_H + +#include + #ifdef Q_OS_WINCE #include diff --git a/src/widgets/styles/qcommonstylepixmaps_p.h b/src/widgets/styles/qcommonstylepixmaps_p.h index 0699ff8914..20607ccd60 100644 --- a/src/widgets/styles/qcommonstylepixmaps_p.h +++ b/src/widgets/styles/qcommonstylepixmaps_p.h @@ -39,6 +39,8 @@ ** ****************************************************************************/ +#include + #ifndef QT_NO_IMAGEFORMAT_XPM // diff --git a/src/widgets/widgets/qscrollarea_p.h b/src/widgets/widgets/qscrollarea_p.h index ee38221877..c5c00d3451 100644 --- a/src/widgets/widgets/qscrollarea_p.h +++ b/src/widgets/widgets/qscrollarea_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #ifndef QT_NO_SCROLLAREA #include "private/qabstractscrollarea_p.h" -- cgit v1.2.3