QOperatingSystemVersion: (potentially) fix compilation with QNX 6

According to qcompilerdetection.h, the Dinkumware C++ library does not
have std::initializer_list, even though the compiler supports it.

Add the missing Q_COMPILER_ guards.

Change-Id: I84a7d5054c00dba38bcde15e277ceb0ee05e6cd7
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Marc Mutz 2017-06-22 21:35:44 +02:00
parent d0ff272af3
commit b7227d7c40
2 changed files with 4 additions and 0 deletions

View File

@ -336,6 +336,7 @@ QString QOperatingSystemVersion::name() const
}
}
#ifdef Q_COMPILER_INITIALIZER_LISTS
/*!
\fn bool QOperatingSystemVersion::isAnyOfType(std::initializer_list<OSType> types) const
@ -350,6 +351,7 @@ bool QOperatingSystemVersion::isAnyOfType(std::initializer_list<OSType> types) c
}
return false;
}
#endif
/*!
\variable QOperatingSystemVersion::Windows7

View File

@ -98,7 +98,9 @@ public:
Q_DECL_CONSTEXPR int segmentCount() const
{ return m_micro >= 0 ? 3 : m_minor >= 0 ? 2 : m_major >= 0 ? 1 : 0; }
#ifdef Q_COMPILER_INITIALIZER_LISTS
bool isAnyOfType(std::initializer_list<OSType> types) const;
#endif
Q_DECL_CONSTEXPR OSType type() const { return m_os; }
QString name() const;