summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2018-06-19 22:51:05 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2018-06-21 19:52:54 +0000
commit2a1d0c2669609f4e646143b279064c1979426a02 (patch)
tree761ff23a25dee93cd5a74f9f0f3066d6dd2cf13a /src
parent5417949fe271a9b2284f4a7df2c58e51c700fe97 (diff)
Compiler detection: add support for C++17's [[deprecated]] on enumerators
Change-Id: I5cff94d036bd311aee2b6418dd793fde89de0938 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qcompilerdetection.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index e5e47082d8..87ade23503 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -1152,6 +1152,11 @@
# define Q_REQUIRED_RESULT [[nodiscard]]
#endif
+#if defined(__cpp_enumerator_attributes) && __cpp_enumerator_attributes >= 201411
+# define Q_DECL_ENUMERATOR_DEPRECATED Q_DECL_DEPRECATED
+# define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
+#endif
+
/*
* Fallback macros to certain compiler features
*/
@@ -1186,6 +1191,12 @@
#ifndef Q_DECL_DEPRECATED_X
# define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
#endif
+#ifndef Q_DECL_ENUMERATOR_DEPRECATED
+# define Q_DECL_ENUMERATOR_DEPRECATED
+#endif
+#ifndef Q_DECL_ENUMERATOR_DEPRECATED_X
+# define Q_DECL_ENUMERATOR_DEPRECATED_X(x)
+#endif
#ifndef Q_DECL_EXPORT
# define Q_DECL_EXPORT
#endif