aboutsummaryrefslogtreecommitdiffstats
path: root/lib/same70b/include/component/deprecated/template.h
diff options
context:
space:
mode:
authorAlex Maclean <monkeh@monkeh.net>2021-08-18 19:30:06 +0100
committerKevin O'Connor <kevin@koconnor.net>2022-03-26 11:59:27 -0400
commit99c2bf0dede623264777812fd324499325babc48 (patch)
treeeccb177c88627f556dff24d7a7c74ee20ac0f5ba /lib/same70b/include/component/deprecated/template.h
parentbefb503cf0df9c23923cd47b40331006624490b2 (diff)
downloadkutter-99c2bf0dede623264777812fd324499325babc48.tar.gz
kutter-99c2bf0dede623264777812fd324499325babc48.tar.xz
kutter-99c2bf0dede623264777812fd324499325babc48.zip
lib: Add Atmel SAM E70 headers
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
Diffstat (limited to 'lib/same70b/include/component/deprecated/template.h')
-rw-r--r--lib/same70b/include/component/deprecated/template.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/same70b/include/component/deprecated/template.h b/lib/same70b/include/component/deprecated/template.h
new file mode 100644
index 00000000..0fd033ca
--- /dev/null
+++ b/lib/same70b/include/component/deprecated/template.h
@@ -0,0 +1,41 @@
+/**
+ * \file
+ * \brief This file is for deprecated macro constants
+ *
+ * Used to mark macro constants as deprecate.
+ * Uses a macro 'DEPRECTAED' to give warnings during compilation (GCC >= 4.8)
+ *
+ * \remark To use, add defines and put a DEPRECATED statement between the macro name and the value
+ *
+ * \note This file is manually maintained
+ */
+
+#ifndef _<DEVICE>_<MODULE>_COMPONENT_DEPRECATED_H_
+#define _<DEVICE>_<MODULE>_COMPONENT_DEPRECATED_H_
+
+#ifndef DEPRECATED
+#define _DEP_STRING(X) #X
+
+/** \hideinitializer
+ * \brief Macro deprecation mark
+ *
+ * Putting this in a macro definition will emit deprecation warning when given
+ * macro is used (GCC 4.8)
+ *
+ * \code{.c}
+ * #define OLD_MACRO DEPRECATED(OLD_MACRO, "deprecated <or any other text>") <value>
+ * \endcode
+ *
+ * \warning Using these macros in #if statements will not work
+ */
+#if defined(__GNUC__) && __GNUC__*100 + __GNUC_MINOR__ >= 408
+#define DEPRECATED(macro, message) _Pragma (_DEP_STRING(GCC warning message))
+#else
+#define DEPRECATED(macro, message)
+#endif
+#endif
+
+/* deprecated defines added below here */
+#define <MODULE>_OLD_MACRO DEPRECATED(<MODULE>_OLD_MACRO, "deprecated") <value>
+
+#endif