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>
bb10
Thomas Miller 2018-07-30 14:07:11 -07:00
parent f1243f6d44
commit 5568744b75
1 changed files with 8 additions and 0 deletions

View File

@ -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