diff options
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/global.pri | 9 | ||||
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 19 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 9 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 4 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.h | 2 |
5 files changed, 26 insertions, 17 deletions
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index 789f500cab..efa585ff3e 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -29,15 +29,6 @@ SOURCES += \ # qlibraryinfo.cpp includes qconfig.cpp INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global -# configure creates these, not syncqt, so we need to manually inject them -qconfig_h_files = \ - $$OUT_PWD/global/qfeatures.h \ - $$OUT_PWD/global/qconfig.h \ - $$QT_BUILD_TREE/include/QtCore/QtConfig -targ_headers.files += $$qconfig_h_files -contains(QMAKE_BUNDLE_DATA, FRAMEWORK_HEADERS): \ - FRAMEWORK_HEADERS.files += $$qconfig_h_files - # Only used on platforms with CONFIG += precompile_header PRECOMPILED_HEADER = global/qt_pch.h diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 70f45345c6..1eb442aa5f 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -489,6 +489,7 @@ #ifdef Q_CC_INTEL # define Q_COMPILER_RESTRICTED_VLA +# define Q_COMPILER_VARIADIC_MACROS // C++11 feature supported as an extension in other modes, too # if __INTEL_COMPILER < 1200 # define Q_NO_TEMPLATE_FRIENDS # endif @@ -498,7 +499,6 @@ # define Q_COMPILER_BINARY_LITERALS # endif # if __cplusplus >= 201103L -# define Q_COMPILER_VARIADIC_MACROS # if __INTEL_COMPILER >= 1200 # define Q_COMPILER_AUTO_TYPE # define Q_COMPILER_CLASS_ENUM @@ -560,6 +560,15 @@ # define Q_COMPILER_BINARY_LITERALS # endif +// Variadic macros are supported for gnu++98, c++11, c99 ... since 2.9 +# if ((__clang_major__ * 100) + __clang_minor__) >= 209 +# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \ + || (defined(__cplusplus) && (__cplusplus >= 201103L)) \ + || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) +# define Q_COMPILER_VARIADIC_MACROS +# endif +# endif + /* C++11 features, see http://clang.llvm.org/cxx_status.html */ # if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) /* Detect C++ features using __has_feature(), see http://clang.llvm.org/docs/LanguageExtensions.html#cxx11 */ @@ -656,7 +665,6 @@ /* Features that have no __has_feature() check */ # if ((__clang_major__ * 100) + __clang_minor__) >= 209 /* since clang 2.9 */ # define Q_COMPILER_EXTERN_TEMPLATES -# define Q_COMPILER_VARIADIC_MACROS # endif # endif @@ -693,13 +701,18 @@ // GCC supports binary literals in C, C++98 and C++11 modes # define Q_COMPILER_BINARY_LITERALS # endif +# if !defined(__STRICT_ANSI__) || defined(__GXX_EXPERIMENTAL_CXX0X__) \ + || (defined(__cplusplus) && (__cplusplus >= 201103L)) \ + || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) + // Variadic macros are supported for gnu++98, c++11, C99 ... since forever (gcc 2.97) +# define Q_COMPILER_VARIADIC_MACROS +# endif # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403 /* C++11 features supported in GCC 4.3: */ # define Q_COMPILER_DECLTYPE # define Q_COMPILER_RVALUE_REFS # define Q_COMPILER_STATIC_ASSERT -# define Q_COMPILER_VARIADIC_MACROS # endif # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 /* C++11 features supported in GCC 4.4: */ diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index fe10c493a7..710f7e8ba1 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -743,7 +743,7 @@ Q_STATIC_ASSERT_X(UCHAR_MAX == 255, "Qt assumes that char is 8 bits"); \relates <QtGlobal> This enum describes the messages that can be sent to a message - handler (QtMsgHandler). You can use the enum to identify and + handler (QtMessageHandler). You can use the enum to identify and associate the various message types with the appropriate actions. @@ -2810,12 +2810,17 @@ int qrand() The char pointer will be invalid after the statement in which qPrintable() is used. This is because the array returned by - toLocal8Bit() will fall out of scope. + QString::toLocal8Bit() will fall out of scope. Example: \snippet code/src_corelib_global_qglobal.cpp 37 + \note qDebug(), qWarning(), qCritical(), qFatal() expect %s + arguments to be UTF-8 encoded, while qPrintable() converts to + local 8-bit encoding. Therefore using qPrintable for logging + strings is only safe if the argument contains only ASCII + characters. \sa qDebug(), qWarning(), qCritical(), qFatal() */ diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index ed1715ddb5..689de48e26 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -287,9 +287,9 @@ QLibraryInfo::buildDate() \since 5.3 */ -const char *QLibraryInfo::build() +const char *QLibraryInfo::build() Q_DECL_NOTHROW { - static const char data[] = "Qt " QT_VERSION_STR " (" __DATE__ "), " + static const char data[] = "Qt " QT_VERSION_STR " (" __DATE__ ", " COMPILER_STRING ", " #if QT_POINTER_SIZE == 4 "32" diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index 2a8a3b84b9..0b573c2e6a 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -59,7 +59,7 @@ public: static QDate buildDate(); #endif //QT_NO_DATESTRING - static const char * build(); + static const char * build() Q_DECL_NOTHROW; static bool isDebugBuild(); |