summaryrefslogtreecommitdiff
path: root/src/components/include/utils/macro.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/include/utils/macro.h')
-rw-r--r--src/components/include/utils/macro.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/include/utils/macro.h b/src/components/include/utils/macro.h
index 4cf76fe022..e6f3b6b3ca 100644
--- a/src/components/include/utils/macro.h
+++ b/src/components/include/utils/macro.h
@@ -145,4 +145,22 @@
#define FRIEND_TEST(test_case_name, test_name)
#endif // BUILD_TESTS
+/*
+* @brief deprecate a method declaration, a warning will be thrown by your
+* compiler if a method with this macro is used
+*/
+#if __cplusplus > 201103L
+#define DEPRECATED [[deprecated]]
+#else
+#ifdef __GNUC__
+#define DEPRECATED __attribute__((deprecated))
+#define DEPRECATED_CLASS __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#define DEPRECATED __declspec(deprecated)
+#else
+#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
+#define DEPRECATED
+#endif
+#endif
+
#endif // SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_