From 82f27c8336aabb7a554923642d68ae6c4f446f58 Mon Sep 17 00:00:00 2001 From: khizmax Date: Tue, 1 Sep 2015 22:30:39 +0300 Subject: [PATCH] Added compiler-specific CDS_DEPRECATED macro --- cds/compiler/clang/defs.h | 6 ++++++ cds/compiler/gcc/defs.h | 6 ++++++ cds/compiler/icl/defs.h | 7 +++++++ cds/compiler/vc/defs.h | 3 +++ 4 files changed, 22 insertions(+) diff --git a/cds/compiler/clang/defs.h b/cds/compiler/clang/defs.h index f10449ec..ce0874c0 100644 --- a/cds/compiler/clang/defs.h +++ b/cds/compiler/clang/defs.h @@ -53,6 +53,12 @@ // Inheriting constructors #define CDS_CXX11_INHERITING_CTOR +// Attributes +#if CDS_COMPILER_VERSION >= 30400 +# define CDS_DEPRECATED( reason ) [[deprecated(reason)]] +else +# define CDS_DEPRECATED( reason ) __attribute__((deprecated( reason ))) +#endif // ************************************************* // Features diff --git a/cds/compiler/gcc/defs.h b/cds/compiler/gcc/defs.h index 386c6237..bd3fcbd0 100644 --- a/cds/compiler/gcc/defs.h +++ b/cds/compiler/gcc/defs.h @@ -56,6 +56,12 @@ #define CDS_CLASS_ALIGNMENT(n) __attribute__ ((aligned (n))) #define CDS_DATA_ALIGNMENT(n) __attribute__ ((aligned (n))) +// Attributes +#if CDS_COMPILER_VERSION >= 40900 +# define CDS_DEPRECATED( reason ) [[deprecated(reason)]] +else +# define CDS_DEPRECATED( reason ) __attribute__((deprecated( reason ))) +#endif #include diff --git a/cds/compiler/icl/defs.h b/cds/compiler/icl/defs.h index 79ffefed..66bb396d 100644 --- a/cds/compiler/icl/defs.h +++ b/cds/compiler/icl/defs.h @@ -102,6 +102,13 @@ # define CDS_DATA_ALIGNMENT(n) __attribute__ ((aligned (n))) #endif +// Attributes +#if CDS_OS_INTERFACE == CDS_OSI_WINDOWS +# define CDS_DEPRECATED( reason ) __declspec(deprecated( reason )) +#else +# define CDS_DEPRECATED( reason ) __attribute__((deprecated( reason ))) +#endif + #include //@endcond diff --git a/cds/compiler/vc/defs.h b/cds/compiler/vc/defs.h index 908aa008..9fe924f0 100644 --- a/cds/compiler/vc/defs.h +++ b/cds/compiler/vc/defs.h @@ -121,6 +121,9 @@ #define CDS_DATA_ALIGNMENT(n) __declspec( align(n) ) #define CDS_CLASS_ALIGNMENT(n) __declspec( align(n) ) +// Attributes +#define CDS_DEPRECATED( reason ) __declspec(deprecated( reason )) + #include //@endcond -- 2.34.1