Fix MSVC builds with /Zc:wchar_t-
208c71768
introduced a problem for our users, who build on Windows with
/Zc:wchar_t-, which makes wchar_t a typedef for the type 'unsigned short',
preventing them from switching to more recent versions of Qt. While MSDN
recommends against this option, we can add more #if-ery to avoid compiler's
bailing out on a constructor's redefinition.
Task-number: QTBUG-65101
Change-Id: I62a1d9b2572f3d4b1f70bcbc3e52e795b1944558
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
ad8a7f0c50
commit
c575977645
@ -93,7 +93,9 @@ public:
|
||||
Q_STATIC_ASSERT(sizeof(wchar_t) == sizeof(ushort));
|
||||
#endif
|
||||
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
|
||||
# if !defined(_WCHAR_T_DEFINED) || defined(_NATIVE_WCHAR_T_DEFINED)
|
||||
Q_DECL_CONSTEXPR QChar(wchar_t ch) Q_DECL_NOTHROW : ucs(ushort(ch)) {} // implicit
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_CAST_FROM_ASCII
|
||||
|
Loading…
Reference in New Issue
Block a user