Guard WinRT API code for clang-cl
It is unsupported with clang-cl and breaks the build. This is a fixup for: 51e8d3592a Let QLocale::uiLanguages() use WinRT API when possible Task-number: QTBUG-94341 Pick-to: 6.2 Change-Id: Icf32339e81d67d4c119b7fb8d8d834c744b9ead0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
ced47a05aa
commit
d24651d548
@ -796,7 +796,8 @@ qt_internal_extend_target(Core CONDITION WIN32
|
||||
text/qlocale_win.cpp
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION WIN32 AND MSVC
|
||||
# On MS-Win, clang has two flavors, one of which immitates MSVC (so claims to be it)
|
||||
qt_internal_extend_target(Core CONDITION WIN32 AND MSVC AND NOT CLANG
|
||||
LIBRARIES
|
||||
runtimeobject
|
||||
)
|
||||
|
@ -51,7 +51,7 @@
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
#if defined(Q_CC_MSVC)
|
||||
#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
|
||||
# include <winrt/base.h>
|
||||
// Workaround for Windows SDK bug.
|
||||
// See https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/47
|
||||
@ -63,7 +63,7 @@ namespace winrt::impl
|
||||
# include <winrt/Windows.Foundation.h>
|
||||
# include <winrt/Windows.Foundation.Collections.h>
|
||||
# include <winrt/Windows.System.UserProfile.h>
|
||||
#endif // defined(Q_CC_MSVC)
|
||||
#endif // defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -630,7 +630,7 @@ QVariant QSystemLocalePrivate::toCurrencyString(const QSystemLocale::CurrencyToS
|
||||
QVariant QSystemLocalePrivate::uiLanguages()
|
||||
{
|
||||
QStringList result;
|
||||
#if defined(Q_CC_MSVC) // msvc supports WinRT calls
|
||||
#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) // msvc supports WinRT calls
|
||||
using namespace winrt;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::System::UserProfile;
|
||||
@ -639,7 +639,7 @@ QVariant QSystemLocalePrivate::uiLanguages()
|
||||
result << QString::fromStdString(winrt::to_string(lang));
|
||||
if (!result.isEmpty())
|
||||
return result; // else just fall back to WIN32 API implementation
|
||||
#endif // defined(Q_CC_MSVC)
|
||||
#endif // defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
|
||||
// mingw and clang still have to use Win32 API
|
||||
unsigned long cnt = 0;
|
||||
QVarLengthArray<wchar_t, 64> buf(64);
|
||||
|
Loading…
x
Reference in New Issue
Block a user