From 7d79e997683930f4f7b3ce1db314683d6e82ea31 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 21 Feb 2012 17:27:39 +0100 Subject: Fail with #error early if the compiler does not support bool or explicit. The fail mode for bool is moved from later in qglobal.h, and explicit is used unguarded throughout Qt, so the macro is already useless. Change-Id: Iff26892b025ba155e360a1f2dc93a67a6622dbc1 Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 1fb5778f14..58bdf06fb5 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -275,11 +275,6 @@ typedef unsigned int uint; typedef unsigned long ulong; QT_END_INCLUDE_NAMESPACE -#if defined(Q_NO_BOOL_TYPE) -#error "Compiler doesn't support the bool type" -#endif - - /* Constant bool values */ -- cgit v1.2.3 From 13c7de63a15c2b47e07516650ba4f1b70f94680e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 22 Feb 2012 18:17:53 +0100 Subject: Don't do macro self-expansion for moc anymore. Change-Id: Ia34cc244a160c6c4abe6dacd7a2ce29bc4fc7bfb Reviewed-by: Olivier Goffart --- src/corelib/global/qglobal.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 58bdf06fb5..485f08bfce 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -310,9 +310,7 @@ QT_END_INCLUDE_NAMESPACE /* Warnings and errors when using deprecated methods */ -#if defined(Q_MOC_RUN) -# define Q_DECL_DEPRECATED Q_DECL_DEPRECATED -#elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT) +#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT) # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__)) #elif defined(Q_CC_MSVC) # define Q_DECL_DEPRECATED __declspec(deprecated) @@ -327,9 +325,7 @@ QT_END_INCLUDE_NAMESPACE # define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED #endif #ifndef Q_DECL_CONSTRUCTOR_DEPRECATED -# if defined(Q_MOC_RUN) -# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED -# elif defined(Q_NO_DEPRECATED_CONSTRUCTORS) +# if defined(Q_NO_DEPRECATED_CONSTRUCTORS) # define Q_DECL_CONSTRUCTOR_DEPRECATED # else # define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED -- cgit v1.2.3 From 52c253fa33162c1db2d0cb0916e0de188b9a0aae Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 23 Feb 2012 00:22:59 +0100 Subject: Remove QT_ASCII_CAST_WARN_CONSTRUCTOR GCC version < 3 which it was created for is not supported anymore. Change-Id: I0b4df4c99600cacbaafbf0bc4270cd4978600956 Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 485f08bfce..e7a6b59f2e 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -385,15 +385,8 @@ QT_END_INCLUDE_NAMESPACE #ifdef QT_ASCII_CAST_WARNINGS # define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED -# if defined(Q_CC_GNU) && __GNUC__ < 4 - /* gcc < 4 doesn't like Q_DECL_DEPRECATED in front of constructors */ -# define QT_ASCII_CAST_WARN_CONSTRUCTOR -# else -# define QT_ASCII_CAST_WARN_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED -# endif #else # define QT_ASCII_CAST_WARN -# define QT_ASCII_CAST_WARN_CONSTRUCTOR #endif #if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE) -- cgit v1.2.3 From cf2ca62dcd2494155b9c07d6a14df7c453226c1e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 22 Feb 2012 14:25:33 +0100 Subject: Require compiler support for deprecated constructors. Change-Id: I1d4cdcbbddb7895e6529e4f6b5295312e9a3a0e6 Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index e7a6b59f2e..acafde595d 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -324,13 +324,6 @@ QT_END_INCLUDE_NAMESPACE #ifndef Q_DECL_VARIABLE_DEPRECATED # define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED #endif -#ifndef Q_DECL_CONSTRUCTOR_DEPRECATED -# if defined(Q_NO_DEPRECATED_CONSTRUCTORS) -# define Q_DECL_CONSTRUCTOR_DEPRECATED -# else -# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED -# endif -#endif #if defined(QT_NO_DEPRECATED) # undef QT_DEPRECATED -- cgit v1.2.3 From de5ebd342f46567a04b58ed28a55ebae48041847 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 23 Feb 2012 00:45:22 +0100 Subject: Remove unused define QT_NO_COP. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It used to relate to QCop and QWS, which are no more. Change-Id: Ie70c64a3a6ef60664009108b79eed7f33ea59f32 Reviewed-by: Jørgen Lind --- src/corelib/global/qglobal.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index acafde595d..ecd981614a 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -489,10 +489,6 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max class QDataStream; -#if !defined(QT_NO_COP) -# define QT_NO_COP -#endif - #if defined(Q_OS_VXWORKS) # define QT_NO_CRASHHANDLER // no popen # define QT_NO_PROCESS // no exec*, no fork -- cgit v1.2.3 From 5a3496ce884dc6b2135ed9154b1da00aa0b64188 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 23 Feb 2012 00:47:54 +0100 Subject: Remove QT_NO_QWS_MULTIPROCESS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1d6731dc5268919d0c36d5d27285321742be708f Reviewed-by: Jørgen Lind --- src/corelib/global/qglobal.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index ecd981614a..382a05deea 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -495,7 +495,6 @@ class QDataStream; # define QT_NO_LPR # define QT_NO_SHAREDMEMORY // only POSIX, no SysV and in the end... # define QT_NO_SYSTEMSEMAPHORE // not needed at all in a flat address space -# define QT_NO_QWS_MULTIPROCESS // no processes #endif # include @@ -1452,7 +1451,6 @@ Q_CORE_EXPORT int qrand(); #ifdef Q_OS_QNX // QNX doesn't have SYSV style shared memory. Multiprocess QWS apps, // shared fonts and QSystemSemaphore + QSharedMemory are not available -# define QT_NO_QWS_MULTIPROCESS # define QT_NO_QWS_SHARE_FONTS # define QT_NO_SYSTEMSEMAPHORE # define QT_NO_SHAREDMEMORY -- cgit v1.2.3 From 9c92df82ddd420867fc5b66616046695557fe7f6 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 23 Feb 2012 00:48:54 +0100 Subject: Remove unused QT_NO_QWS_SHARE_FONTS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I47e8111d6caffd9b45096e52695acaa55945c612 Reviewed-by: Jørgen Lind --- src/corelib/global/qglobal.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 382a05deea..47d56d7c1b 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1451,7 +1451,6 @@ Q_CORE_EXPORT int qrand(); #ifdef Q_OS_QNX // QNX doesn't have SYSV style shared memory. Multiprocess QWS apps, // shared fonts and QSystemSemaphore + QSharedMemory are not available -# define QT_NO_QWS_SHARE_FONTS # define QT_NO_SYSTEMSEMAPHORE # define QT_NO_SHAREDMEMORY #endif -- cgit v1.2.3 From 2a771cef4a939d26f6ffc45caa690330b33882c9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 24 Feb 2012 17:33:25 +0100 Subject: QFlags<>: let the compiler generate copy ctor/op= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The user-defined copy constructor and copy-assignment operators were 100% equivalent to the ones the compiler would generate, so let the compiler generate them (so we reap move constructors, too, even though they're not needed on this class). Change-Id: Iecdd579fa5a819d083ec9b2f25734ddba85515e6 Reviewed-by: João Abecasis Reviewed-by: Olivier Goffart --- src/corelib/global/qglobal.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 47d56d7c1b..b159a877b7 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1225,12 +1225,15 @@ class QFlags int i; public: typedef Enum enum_type; - Q_DECL_CONSTEXPR inline QFlags(const QFlags &f) : i(f.i) {} + // compiler-generated copy/move ctor/assignment operators are fine! +#ifdef qdoc + inline QFlags(const QFlags &other); + inline QFlags &operator=(const QFlags &other); +#endif Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {} Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {} inline QFlags(QFlag f) : i(f) {} - inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; } inline QFlags &operator&=(int mask) { i &= mask; return *this; } inline QFlags &operator&=(uint mask) { i &= mask; return *this; } inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; } -- cgit v1.2.3 From 1a49a529ee3e721ea8736bd0c34a0086a2dbad4d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 22 Feb 2012 14:49:13 +0100 Subject: Remove more support for unsupported GCC versions. Change-Id: I827c9f982a7d7d20913b99c8fdaf98437a0a73db Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index b159a877b7..5fbc8cdd19 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -191,7 +191,7 @@ namespace QT_NAMESPACE {} #endif #ifndef Q_REQUIRED_RESULT -# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) +# if defined(Q_CC_GNU) # define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result)) # else # define Q_REQUIRED_RESULT @@ -310,7 +310,7 @@ QT_END_INCLUDE_NAMESPACE /* Warnings and errors when using deprecated methods */ -#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT) +#if defined(Q_CC_GNU) || defined(Q_CC_RVCT) # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__)) #elif defined(Q_CC_MSVC) # define Q_DECL_DEPRECATED __declspec(deprecated) @@ -384,11 +384,7 @@ QT_END_INCLUDE_NAMESPACE #if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE) # if defined(Q_CC_GNU) -#if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332) # define QT_FASTCALL __attribute__((regparm(3))) -#else -# define QT_FASTCALL -#endif # elif defined(Q_CC_MSVC) # define QT_FASTCALL __fastcall # else -- cgit v1.2.3