aboutsummaryrefslogtreecommitdiff
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
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>
-rw-r--r--configure.ac1
-rw-r--r--doc/helper-guide/Doxyfile1
-rw-r--r--helper/Makefile.am3
-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
-rw-r--r--helper/m4/configure.m412
7 files changed, 60 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 9a950a115..bf7c52e09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -539,6 +539,7 @@ AC_MSG_RESULT([
ABI compatible: ${abi_compat}
link time optimization: ${lto_enabled}
deprecated APIs: ${deprecated}
+ deprecated helper APIs: ${enable_helper_deprecated}
debug: ${debug_settings}
cunit: ${cunit_support}
static tests linkage: ${enable_static_applications}
diff --git a/doc/helper-guide/Doxyfile b/doc/helper-guide/Doxyfile
index 52d542e73..74eb6b94f 100644
--- a/doc/helper-guide/Doxyfile
+++ b/doc/helper-guide/Doxyfile
@@ -35,3 +35,4 @@ MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
INTERNAL_DOCS = YES
DOT_IMAGE_FORMAT = svg
+PREDEFINED = ODPH_DEPRECATE(x)=x
diff --git a/helper/Makefile.am b/helper/Makefile.am
index 264b3d365..2b89c2223 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -14,6 +14,7 @@ AM_LDFLAGS = -version-number '$(ODPHELPER_LIBSO_VERSION)'
helperincludedir = $(includedir)/odp/helper/
helperinclude_HEADERS = \
include/odp/helper/autoheader_external.h\
+ include/odp/helper/deprecated.h\
include/odp/helper/chksum.h\
include/odp/helper/odph_debug.h \
include/odp/helper/eth.h\
@@ -80,7 +81,7 @@ __LIB__libodphelper_la_LIBADD += $(LIBCLI_LIBS)
lib_LTLIBRARIES = $(LIB)/libodphelper.la
-CHECK_GLOBALS_REGEX = " odph_"
+CHECK_GLOBALS_REGEX = " (odph_|_deprecated_odph_)"
TESTS_ENVIRONMENT = \
LIBTOOL="$(LIBTOOL)" \
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
diff --git a/helper/m4/configure.m4 b/helper/m4/configure.m4
index 36629c81e..2e1076172 100644
--- a/helper/m4/configure.m4
+++ b/helper/m4/configure.m4
@@ -47,5 +47,17 @@ AS_IF([test "x$enable_helper_debug_print" != "xno"], [ODPH_DEBUG_PRINT=1],
AC_DEFINE_UNQUOTED([ODPH_DEBUG_PRINT], [$ODPH_DEBUG_PRINT],
[Define to 1 to display helper debug information])
+##########################################################################
+# Enable/disable deprecated helper API definitions
+##########################################################################
+AC_ARG_ENABLE([helper-deprecated],
+ [AS_HELP_STRING([--enable-helper-deprecated],
+ [enable deprecated helper API definitions [default=disabled]])],
+ [], [enable_helper_deprecated=no])
+AS_IF([test "x$enable_helper_deprecated" != "xno"], [ODPH_DEPRECATED_API=1],
+ [ODPH_DEPRECATED_API=0])
+AC_DEFINE_UNQUOTED([ODPH_DEPRECATED_API], [$ODPH_DEPRECATED_API],
+ [Define to 1 to enable deprecated helper API definitions])
+
AC_CONFIG_FILES([helper/libodphelper.pc
helper/test/Makefile])