Added the preprocessor macro Q_DECL_DEPRECATED_X

Added a macro to provide deprecation warnings with a custom text.  If
the compiler does not support the feature, it falls back to
Q_DECL_DEPRECATED instead.

Currently supports msvc, gcc, and clang.  The armcc documentation didn't
show that the feature was available.

Change-Id: Iebdb00738a135c756e032eb76152c405a8c29a45
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Keith Gardner 2013-10-12 12:13:36 -05:00 committed by The Qt Project
parent 24cc181f04
commit da35793ee5
1 changed files with 5 additions and 0 deletions

View File

@ -98,6 +98,7 @@
# define Q_UNREACHABLE_IMPL() __assume(0)
# define Q_NORETURN __declspec(noreturn)
# define Q_DECL_DEPRECATED __declspec(deprecated)
# define Q_DECL_DEPRECATED_X(text) __declspec(deprecated(text))
# define Q_DECL_EXPORT __declspec(dllexport)
# define Q_DECL_IMPORT __declspec(dllimport)
/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */
@ -182,6 +183,7 @@
# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
# define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# define Q_DECL_UNUSED __attribute__((__unused__))
# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
@ -838,6 +840,9 @@
#ifndef Q_DECL_VARIABLE_DEPRECATED
# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
#endif
#ifndef Q_DECL_DEPRECATED_X
# define Q_DECL_DEPRECATED_X(text) Q_DECL_DEPRECATED
#endif
#ifndef Q_DECL_EXPORT
# define Q_DECL_EXPORT
#endif