diff mbox

[PATCHv2] api: hints: move internal hints into a public header

Message ID 1424953260-27265-1-git-send-email-taras.kondratiuk@linaro.org
State Accepted
Commit c032bc382d6989ee8326f03303d9a67503c69739
Headers show

Commit Message

Taras Kondratiuk Feb. 26, 2015, 12:21 p.m. UTC
It is useful to have ODP_UNUSED and ODP_DEPRECATED macros in a public
header. For example to mark some API as deprecated in future.

Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
---
v2: Updated commit name and message.

 include/odp/api/hints.h                             | 12 ++++++++++++
 platform/linux-generic/include/odp_debug_internal.h | 19 -------------------
 2 files changed, 12 insertions(+), 19 deletions(-)

Comments

Mike Holmes Feb. 26, 2015, 12:22 p.m. UTC | #1
On 26 February 2015 at 07:21, Taras Kondratiuk <taras.kondratiuk@linaro.org>
wrote:

> It is useful to have ODP_UNUSED and ODP_DEPRECATED macros in a public
> header. For example to mark some API as deprecated in future.
>
> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
>

Reviewed-by: Mike Holmes <mike.holmes@linaro.org>


> ---
> v2: Updated commit name and message.
>
>  include/odp/api/hints.h                             | 12 ++++++++++++
>  platform/linux-generic/include/odp_debug_internal.h | 19
> -------------------
>  2 files changed, 12 insertions(+), 19 deletions(-)
>
> diff --git a/include/odp/api/hints.h b/include/odp/api/hints.h
> index 4211994..ea67fc4 100644
> --- a/include/odp/api/hints.h
> +++ b/include/odp/api/hints.h
> @@ -51,6 +51,16 @@ extern "C" {
>  #define ODP_PRINTF_FORMAT(x, y) __attribute__((format(printf, (x), (y))))
>
>  /**
> + * Indicate deprecated variables, functions or types
> + */
> +#define ODP_DEPRECATED __attribute__((__deprecated__))
> +
> +/**
> + * Intentionally unused variables ot functions
> + */
> +#define ODP_UNUSED     __attribute__((__unused__))
> +
> +/**
>   * Branch likely taken
>   */
>  #define odp_likely(x)   __builtin_expect((x), 1)
> @@ -85,6 +95,8 @@ extern "C" {
>  #define ODP_WEAK_SYMBOL
>  #define ODP_HOT_CODE
>  #define ODP_COLD_CODE
> +#define ODP_DEPRECATED
> +#define ODP_UNUSED
>  #define odp_likely(x)
>  #define odp_unlikely(x)
>  #define odp_prefetch(x)
> diff --git a/platform/linux-generic/include/odp_debug_internal.h
> b/platform/linux-generic/include/odp_debug_internal.h
> index 2b643eb..dec5c15 100644
> --- a/platform/linux-generic/include/odp_debug_internal.h
> +++ b/platform/linux-generic/include/odp_debug_internal.h
> @@ -29,25 +29,6 @@ extern "C" {
>   *  @{
>   */
>
> -#ifdef __GNUC__
> -
> -/**
> - * Indicate deprecated variables, functions or types
> - */
> -#define ODP_DEPRECATED __attribute__((__deprecated__))
> -
> -/**
> - * Intentionally unused variables ot functions
> - */
> -#define ODP_UNUSED     __attribute__((__unused__))
> -
> -#else
> -
> -#define ODP_DEPRECATED
> -#define ODP_UNUSED
> -
> -#endif
> -
>  /**
>   * Runtime assertion-macro - aborts if 'cond' is false.
>   */
> --
> 1.9.1
>
>
Maxim Uvarov Feb. 26, 2015, 2:40 p.m. UTC | #2
Merged,
Maxim.

On 02/26/2015 03:21 PM, Taras Kondratiuk wrote:
> It is useful to have ODP_UNUSED and ODP_DEPRECATED macros in a public
> header. For example to mark some API as deprecated in future.
>
> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
> ---
> v2: Updated commit name and message.
>
>   include/odp/api/hints.h                             | 12 ++++++++++++
>   platform/linux-generic/include/odp_debug_internal.h | 19 -------------------
>   2 files changed, 12 insertions(+), 19 deletions(-)
>
> diff --git a/include/odp/api/hints.h b/include/odp/api/hints.h
> index 4211994..ea67fc4 100644
> --- a/include/odp/api/hints.h
> +++ b/include/odp/api/hints.h
> @@ -51,6 +51,16 @@ extern "C" {
>   #define ODP_PRINTF_FORMAT(x, y) __attribute__((format(printf, (x), (y))))
>   
>   /**
> + * Indicate deprecated variables, functions or types
> + */
> +#define ODP_DEPRECATED __attribute__((__deprecated__))
> +
> +/**
> + * Intentionally unused variables ot functions
> + */
> +#define ODP_UNUSED     __attribute__((__unused__))
> +
> +/**
>    * Branch likely taken
>    */
>   #define odp_likely(x)   __builtin_expect((x), 1)
> @@ -85,6 +95,8 @@ extern "C" {
>   #define ODP_WEAK_SYMBOL
>   #define ODP_HOT_CODE
>   #define ODP_COLD_CODE
> +#define ODP_DEPRECATED
> +#define ODP_UNUSED
>   #define odp_likely(x)
>   #define odp_unlikely(x)
>   #define odp_prefetch(x)
> diff --git a/platform/linux-generic/include/odp_debug_internal.h b/platform/linux-generic/include/odp_debug_internal.h
> index 2b643eb..dec5c15 100644
> --- a/platform/linux-generic/include/odp_debug_internal.h
> +++ b/platform/linux-generic/include/odp_debug_internal.h
> @@ -29,25 +29,6 @@ extern "C" {
>    *  @{
>    */
>   
> -#ifdef __GNUC__
> -
> -/**
> - * Indicate deprecated variables, functions or types
> - */
> -#define ODP_DEPRECATED __attribute__((__deprecated__))
> -
> -/**
> - * Intentionally unused variables ot functions
> - */
> -#define ODP_UNUSED     __attribute__((__unused__))
> -
> -#else
> -
> -#define ODP_DEPRECATED
> -#define ODP_UNUSED
> -
> -#endif
> -
>   /**
>    * Runtime assertion-macro - aborts if 'cond' is false.
>    */
diff mbox

Patch

diff --git a/include/odp/api/hints.h b/include/odp/api/hints.h
index 4211994..ea67fc4 100644
--- a/include/odp/api/hints.h
+++ b/include/odp/api/hints.h
@@ -51,6 +51,16 @@  extern "C" {
 #define ODP_PRINTF_FORMAT(x, y) __attribute__((format(printf, (x), (y))))
 
 /**
+ * Indicate deprecated variables, functions or types
+ */
+#define ODP_DEPRECATED __attribute__((__deprecated__))
+
+/**
+ * Intentionally unused variables ot functions
+ */
+#define ODP_UNUSED     __attribute__((__unused__))
+
+/**
  * Branch likely taken
  */
 #define odp_likely(x)   __builtin_expect((x), 1)
@@ -85,6 +95,8 @@  extern "C" {
 #define ODP_WEAK_SYMBOL
 #define ODP_HOT_CODE
 #define ODP_COLD_CODE
+#define ODP_DEPRECATED
+#define ODP_UNUSED
 #define odp_likely(x)
 #define odp_unlikely(x)
 #define odp_prefetch(x)
diff --git a/platform/linux-generic/include/odp_debug_internal.h b/platform/linux-generic/include/odp_debug_internal.h
index 2b643eb..dec5c15 100644
--- a/platform/linux-generic/include/odp_debug_internal.h
+++ b/platform/linux-generic/include/odp_debug_internal.h
@@ -29,25 +29,6 @@  extern "C" {
  *  @{
  */
 
-#ifdef __GNUC__
-
-/**
- * Indicate deprecated variables, functions or types
- */
-#define ODP_DEPRECATED __attribute__((__deprecated__))
-
-/**
- * Intentionally unused variables ot functions
- */
-#define ODP_UNUSED     __attribute__((__unused__))
-
-#else
-
-#define ODP_DEPRECATED
-#define ODP_UNUSED
-
-#endif
-
 /**
  * Runtime assertion-macro - aborts if 'cond' is false.
  */