From fd85b61d1716c3da5cea8c6bde054b79fd5187fc Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 2 Jul 2012 12:24:12 +0200 Subject: [PATCH] Fix internal compiler error of MSVC2012. Default to QLatin1String. Change-Id: I20b74f77ee0828a1c2b1337a3ab2e0012c8df06e Reviewed-by: Michael Goddard --- src/multimedia/qtmedianamespace.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/multimedia/qtmedianamespace.cpp b/src/multimedia/qtmedianamespace.cpp index 94c2dbf0..41cd2e38 100644 --- a/src/multimedia/qtmedianamespace.cpp +++ b/src/multimedia/qtmedianamespace.cpp @@ -62,16 +62,17 @@ namespace gcc's statement-expression extension. However, in this file it will not work, because "statement-expressions are not allowed outside functions nor in template-argument lists". + MSVC 2012 produces an internal compiler error on encountering + QStringLiteral in this context. Fall back to the less-performant QLatin1String in this case. */ -#if defined(QStringLiteral) && defined(QT_UNICODE_LITERAL_II) && defined(Q_CC_GNU) && !defined(Q_COMPILER_LAMBDA) -# undef QStringLiteral -# define QStringLiteral QLatin1String +#if defined(Q_CC_GNU) && defined(Q_COMPILER_LAMBDA) +# define Q_DEFINE_METADATA(key) const QString QtMultimedia::MetaData::key(QStringLiteral(#key)) +#else +# define Q_DEFINE_METADATA(key) const QString QtMultimedia::MetaData::key(QLatin1String(#key)) #endif -#define Q_DEFINE_METADATA(key) const QString QtMultimedia::MetaData::key(QStringLiteral(#key)) - // Common Q_DEFINE_METADATA(Title); Q_DEFINE_METADATA(SubTitle);