diff options
author | Thomas Miller <thomaslmiller91@gmail.com> | 2018-07-30 14:07:11 -0700 |
---|---|---|
committer | Thomas Miller <thomaslmiller91@gmail.com> | 2018-07-30 22:58:56 +0000 |
commit | 5568744b75a344e725d8c71e7ecca930952e79d3 (patch) | |
tree | f636440721a0710ac4e92782cbafb3ea0bc0c92f /src/corelib | |
parent | f1243f6d44b425d2a969ac3a47746f9ed4457c1d (diff) |
Fix qtbase build for MSVC 2017 15.8
Fixed breaks caused by MSVC 2017 15.8 introducing the
__cpp_enumerator_attributes define.
Change-Id: I78144f8f49a7352e574dee379155bd47d8d6d896
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 9906425f5b..2b85ea0815 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1153,9 +1153,17 @@ #endif #if defined(__cpp_enumerator_attributes) && __cpp_enumerator_attributes >= 201411 +#if defined(Q_CC_MSVC) +// Can't mark enum values as __declspec(deprecated) with MSVC, also can't move +// everything to [[deprecated]] because MSVC gives a compilation error when marking +// friend methods of a class as [[deprecated("text")]], breaking qstring.h +# define Q_DECL_ENUMERATOR_DEPRECATED [[deprecated]] +# define Q_DECL_ENUMERATOR_DEPRECATED_X(x) [[deprecated(x)]] +#else # define Q_DECL_ENUMERATOR_DEPRECATED Q_DECL_DEPRECATED # define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x) #endif +#endif /* * Fallback macros to certain compiler features |