Use the [[deprecated]] standard attribute when possible.
* spot/misc/common.hh: Change SPOT_DEPRECATED definition.
This commit is contained in:
parent
22292e6058
commit
5952392494
1 changed files with 13 additions and 6 deletions
|
|
@ -30,12 +30,19 @@
|
||||||
#define SPOT_UNLIKELY(expr) (expr)
|
#define SPOT_UNLIKELY(expr) (expr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __has_cpp_attribute
|
||||||
#define SPOT_DEPRECATED __attribute__ ((deprecated))
|
# if __has_cpp_attribute(deprecated)
|
||||||
#elif defined(_MSC_VER)
|
# define SPOT_DEPRECATED [[deprecated]]
|
||||||
#define SPOT_DEPRECATED __declspec(deprecated)
|
# endif
|
||||||
#else
|
#endif
|
||||||
#define SPOT_DEPRECATED func
|
#ifndef SPOT_DEPRECATED
|
||||||
|
# ifdef __GNUC__
|
||||||
|
# define SPOT_DEPRECATED __attribute__ ((deprecated))
|
||||||
|
# elif defined(_MSC_VER)
|
||||||
|
# define SPOT_DEPRECATED __declspec(deprecated)
|
||||||
|
# else
|
||||||
|
# define SPOT_DEPRECATED
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _WIN32 || defined __CYGWIN__
|
#if defined _WIN32 || defined __CYGWIN__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue