aboutsummaryrefslogtreecommitdiff
path: root/helper/include
diff options
context:
space:
mode:
authorJere Leppänen <jere.leppanen@nokia.com>2021-09-29 14:17:55 +0300
committerMatias Elo <matias.elo@nokia.com>2021-11-12 09:48:41 +0200
commit7bef61ebe885c6a089d1cd7b3f7f3b6bdf7b8cf7 (patch)
treec84f93220247bf644a7a5f761c95802a2911ad1a /helper/include
parentc4b1cde446777a397c99058de5c19aeffe1faacc (diff)
helper: implement deprecation
Implement deprecation in the helper library. Deprecated helper APIs may be enabled with the --enable-helper-deprecated configure option. By default, deprecated helper APIs are not enabled. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'helper/include')
-rw-r--r--helper/include/odp/helper/autoheader_external.h.in3
-rw-r--r--helper/include/odp/helper/deprecated.h39
-rw-r--r--helper/include/odp/helper/odph_api.h4
3 files changed, 44 insertions, 2 deletions
diff --git a/helper/include/odp/helper/autoheader_external.h.in b/helper/include/odp/helper/autoheader_external.h.in
index 6f5187a5b..81f10a737 100644
--- a/helper/include/odp/helper/autoheader_external.h.in
+++ b/helper/include/odp/helper/autoheader_external.h.in
@@ -11,4 +11,7 @@
/* Define to 1 to display helper debug information */
#undef ODPH_DEBUG_PRINT
+/* Define to 1 to enable deprecated helper API definitions */
+#undef ODPH_DEPRECATED_API
+
#endif
diff --git a/helper/include/odp/helper/deprecated.h b/helper/include/odp/helper/deprecated.h
new file mode 100644
index 000000000..3415b2127
--- /dev/null
+++ b/helper/include/odp/helper/deprecated.h
@@ -0,0 +1,39 @@
+/* Copyright (c) 2017-2018, Linaro Limited
+ * Copyright (c) 2021, Nokia
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * Macro for deprecated API definitions
+ */
+
+#ifndef ODPH_DEPRECATED_H_
+#define ODPH_DEPRECATED_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/helper/autoheader_external.h>
+
+/**
+ * @def ODPH_DEPRECATE
+ *
+ * Macro to deprecate helper API definitions
+ */
+
+#if ODPH_DEPRECATED_API
+#define ODPH_DEPRECATE(x) x
+#else
+#define ODPH_DEPRECATE(x) _deprecated_ ## x
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/helper/include/odp/helper/odph_api.h b/helper/include/odp/helper/odph_api.h
index 7ab875c6e..3c321b9d4 100644
--- a/helper/include/odp/helper/odph_api.h
+++ b/helper/include/odp/helper/odph_api.h
@@ -18,6 +18,8 @@
extern "C" {
#endif
+#include <odp/helper/autoheader_external.h>
+
#include <odp/helper/odph_debug.h>
#include <odp/helper/chksum.h>
#include <odp/helper/odph_cuckootable.h>
@@ -38,8 +40,6 @@ extern "C" {
#include <odp/helper/udp.h>
#include <odp/helper/version.h>
-#include <odp/helper/autoheader_external.h>
-
#ifdef ODPH_CLI
#include <odp/helper/cli.h>
#endif