diff mbox

api: fix odp_version_api_str()

Message ID 1422977052-16544-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Feb. 3, 2015, 3:24 p.m. UTC
odp_version_api_str() has to be in API header while
odp_version_impl_str() should be in linux-generic.
That change fixes:
https://bugs.linaro.org/show_bug.cgi?id=1194

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 include/odp/api/version.h                    | 29 +++++++++++++++-------------
 platform/linux-generic/include/odp/version.h | 25 +++++++++++-------------
 2 files changed, 27 insertions(+), 27 deletions(-)

Comments

Mike Holmes Feb. 3, 2015, 4:08 p.m. UTC | #1
On 3 February 2015 at 10:24, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> odp_version_api_str() has to be in API header while
> odp_version_impl_str() should be in linux-generic.
> That change fixes:
> https://bugs.linaro.org/show_bug.cgi?id=1194
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>  include/odp/api/version.h                    | 29
> +++++++++++++++-------------
>  platform/linux-generic/include/odp/version.h | 25 +++++++++++-------------
>  2 files changed, 27 insertions(+), 27 deletions(-)
>
> diff --git a/include/odp/api/version.h b/include/odp/api/version.h
> index 0889d9c..bfeb40b 100644
> --- a/include/odp/api/version.h
> +++ b/include/odp/api/version.h
> @@ -48,24 +48,27 @@ extern "C" {
>   */
>  #define ODP_VERSION_API_MINOR 0
>
> +/** @internal Version string expand */
> +#define ODP_VERSION_STR_EXPAND(x)  #x
> +
> +/** @internal Version to string */
> +#define ODP_VERSION_TO_STR(x)      ODP_VERSION_STR_EXPAND(x)
> +
> +/** @internal API version string */
> +#define ODP_VERSION_API_STR \
> +ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \
> +ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \
> +ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR)
> +
>

These are now duplicated
in platform/linux-generic/include/odp/plat/version_types.h I think that
file can be deleted


>  /**
>   * Returns ODP API version string
>   */
> -const char *odp_version_api_str(void);
> -
> +static inline const char *odp_version_api_str(void)
> +{
> +       return ODP_VERSION_API_STR;
> +}
>
>  /**
> - * Returns ODP implementation version string
> - *
> - * Every implementation of ODP may receive bug fixes independent of the
> version
> - * of the API changing, this function returns that indication string.
> - * @note This string is implementation specific.
> - * @sa odp_version_api_str()
> - *
> - * @return null terminated implementation specific version identifier
> string
> -  */
> -const char *odp_version_impl_str(void);
> -/**
>   * @}
>   */
>
> diff --git a/platform/linux-generic/include/odp/version.h
> b/platform/linux-generic/include/odp/version.h
> index f29320a..33cc5ba 100644
> --- a/platform/linux-generic/include/odp/version.h
> +++ b/platform/linux-generic/include/odp/version.h
> @@ -17,22 +17,19 @@
>  extern "C" {
>  #endif
>
> -#include <odp/plat/version_types.h>
> -
> -/** @ingroup odp_ver_abt_log_dbg
> - *  @{
> - */
> -
> -static inline const char *odp_version_api_str(void)
> -{
> -       return ODP_VERSION_API_STR;
> -}
> +#include <odp/api/version.h>
>
>  /**
> - * @}
> - */
> -
> -#include <odp/api/version.h>
> + * Returns ODP implementation version string
> + *
> + * Every implementation of ODP may receive bug fixes independent of the
> version
> + * of the API changing, this function returns that indication string.
> + * @note This string is implementation specific.
> + * @sa odp_version_api_str()
> + *
> + * @return null terminated implementation specific version identifier
> string
> +  */
> +const char *odp_version_impl_str(void);
>
>  #ifdef __cplusplus
>  }
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/include/odp/api/version.h b/include/odp/api/version.h
index 0889d9c..bfeb40b 100644
--- a/include/odp/api/version.h
+++ b/include/odp/api/version.h
@@ -48,24 +48,27 @@  extern "C" {
  */
 #define ODP_VERSION_API_MINOR 0
 
+/** @internal Version string expand */
+#define ODP_VERSION_STR_EXPAND(x)  #x
+
+/** @internal Version to string */
+#define ODP_VERSION_TO_STR(x)      ODP_VERSION_STR_EXPAND(x)
+
+/** @internal API version string */
+#define ODP_VERSION_API_STR \
+ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \
+ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \
+ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR)
+
 /**
  * Returns ODP API version string
  */
-const char *odp_version_api_str(void);
-
+static inline const char *odp_version_api_str(void)
+{
+	return ODP_VERSION_API_STR;
+}
 
 /**
- * Returns ODP implementation version string
- *
- * Every implementation of ODP may receive bug fixes independent of the version
- * of the API changing, this function returns that indication string.
- * @note This string is implementation specific.
- * @sa odp_version_api_str()
- *
- * @return null terminated implementation specific version identifier string
-  */
-const char *odp_version_impl_str(void);
-/**
  * @}
  */
 
diff --git a/platform/linux-generic/include/odp/version.h b/platform/linux-generic/include/odp/version.h
index f29320a..33cc5ba 100644
--- a/platform/linux-generic/include/odp/version.h
+++ b/platform/linux-generic/include/odp/version.h
@@ -17,22 +17,19 @@ 
 extern "C" {
 #endif
 
-#include <odp/plat/version_types.h>
-
-/** @ingroup odp_ver_abt_log_dbg
- *  @{
- */
-
-static inline const char *odp_version_api_str(void)
-{
-	return ODP_VERSION_API_STR;
-}
+#include <odp/api/version.h>
 
 /**
- * @}
- */
-
-#include <odp/api/version.h>
+ * Returns ODP implementation version string
+ *
+ * Every implementation of ODP may receive bug fixes independent of the version
+ * of the API changing, this function returns that indication string.
+ * @note This string is implementation specific.
+ * @sa odp_version_api_str()
+ *
+ * @return null terminated implementation specific version identifier string
+  */
+const char *odp_version_impl_str(void);
 
 #ifdef __cplusplus
 }