summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydata.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-04-13 12:36:28 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-05-08 04:25:27 +0000
commite1d0da65261077bfd720887d6e6216497abb4c5f (patch)
treef307c4d70ee6574c762b1943922482974aa07fbd /src/corelib/tools/qarraydata.h
parent1c2210b7b1ecae021d46c8e5a3cb4a53986067c4 (diff)
Fix Clang -Wexpansion-to-defined warning by deprecating QT_SUPPORTS
The C and C++ standards say it's undefined whether the preprocessor supports macros that expand to defined() will operate as an ifdef. Clang 3.9 started complaining about that fact. One solution was to change QT_SUPPORTS to check for zero or one, which means we need to change the #defines QT_NO_xxx to #define QT_NO_xxx 1. The C standard says we don't need to #define to 0, as an unknown token is interpreted as zero. However, that might produce a warning (GCC with -Wundef), so changing the macro this way is not recommended. Instead, we deprecate the macro and replace the uses with #ifdef/ndef. Change-Id: Id75834dab9ed466e94c7ffff1444874d5680b96a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qarraydata.h')
-rw-r--r--src/corelib/tools/qarraydata.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index 865bd4325d..cbbfe1bea2 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -72,7 +72,7 @@ struct Q_CORE_EXPORT QArrayData
enum AllocationOption {
CapacityReserved = 0x1,
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
Unsharable = 0x2,
#endif
RawData = 0x4,
@@ -249,7 +249,7 @@ struct QTypedArrayData
return allocate(/* capacity */ 0);
}
-#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
static QTypedArrayData *unsharableEmpty()
{
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));