Added compiler-specific CDS_DEPRECATED macro
authorkhizmax <libcds.dev@gmail.com>
Tue, 1 Sep 2015 19:30:39 +0000 (22:30 +0300)
committerkhizmax <libcds.dev@gmail.com>
Tue, 1 Sep 2015 19:30:39 +0000 (22:30 +0300)
cds/compiler/clang/defs.h
cds/compiler/gcc/defs.h
cds/compiler/icl/defs.h
cds/compiler/vc/defs.h

index f10449ec8d4534ca717144fb7118c6b1f70f5dde..ce0874c0605b040eb2c72009b80ae331c6b6c967 100644 (file)
 // 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
index 386c6237b2e2f03ed06683f61132d2f918d1dd9f..bd3fcbd03257fa0521a279058e04f9039732e378 100644 (file)
 #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 <cds/compiler/gcc/compiler_barriers.h>
 
index 79ffefedbc0e847422fa8196d8597be368152b47..66bb396dcbdfc2d8fc54f717d27ce78b420ecde8 100644 (file)
 #   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 <cds/compiler/icl/compiler_barriers.h>
 
 //@endcond
index 908aa008b0c4dd467b698b85ac5d782a6df7853b..9fe924f0c20e3da479ce844d915716765965cfc8 100644 (file)
 #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 <cds/compiler/vc/compiler_barriers.h>
 
 //@endcond