diff mbox

[PATCHv3,2/2] linux-generic: move versions to odp_version.c and get rid of odp_impl.c

Message ID 1424174768-8163-3-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Feb. 17, 2015, 12:06 p.m. UTC
Move implementation version to odp_version.c and get rid of odp_impl.c.
Also include required api functions so that str macro unrolls correctly to
version string.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/Makefile.am                 |  4 +--
 .../linux-generic/include/odp/plat/version_types.h | 30 -------------------
 platform/linux-generic/include/odp/version.h       | 16 +++++++++-
 platform/linux-generic/odp_impl.c                  | 35 ----------------------
 platform/linux-generic/odp_version.c               |  7 ++++-
 5 files changed, 22 insertions(+), 70 deletions(-)
 delete mode 100644 platform/linux-generic/include/odp/plat/version_types.h
 delete mode 100644 platform/linux-generic/odp_impl.c
diff mbox

Patch

diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 16adccc..b77b05b 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -61,8 +61,7 @@  odpplatinclude_HEADERS = \
 		  $(top_srcdir)/platform/linux-generic/include/odp/plat/schedule_types.h \
 		  $(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h \
 		  $(top_srcdir)/platform/linux-generic/include/odp/plat/strong_types.h \
-		  $(top_srcdir)/platform/linux-generic/include/odp/plat/timer_types.h \
-		  $(top_srcdir)/platform/linux-generic/include/odp/plat/version_types.h
+		  $(top_srcdir)/platform/linux-generic/include/odp/plat/timer_types.h
 
 odpapiincludedir= $(includedir)/odp/api
 odpapiinclude_HEADERS = \
@@ -144,7 +143,6 @@  __LIB__libodp_la_SOURCES = \
 			   odp_errno.c \
 			   odp_event.c \
 			   odp_init.c \
-			   odp_impl.c \
 			   odp_linux.c \
 			   odp_packet.c \
 			   odp_packet_flags.c \
diff --git a/platform/linux-generic/include/odp/plat/version_types.h b/platform/linux-generic/include/odp/plat/version_types.h
deleted file mode 100644
index e3327eb..0000000
--- a/platform/linux-generic/include/odp/plat/version_types.h
+++ /dev/null
@@ -1,30 +0,0 @@ 
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier:     BSD-3-Clause
- */
-
-#ifndef ODP_VERSION_TYPESH_
-#define ODP_VERSION_TYPESH_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @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)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/platform/linux-generic/include/odp/version.h b/platform/linux-generic/include/odp/version.h
index c98cb30..8a95221 100644
--- a/platform/linux-generic/include/odp/version.h
+++ b/platform/linux-generic/include/odp/version.h
@@ -17,9 +17,23 @@ 
 extern "C" {
 #endif
 
-#include <odp/plat/version_types.h>
+/** @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)
+
 #include <odp/api/version.h>
 
+#define  ODP_VERSION_IMPL 0
+#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/odp_impl.c b/platform/linux-generic/odp_impl.c
deleted file mode 100644
index ca3224d..0000000
--- a/platform/linux-generic/odp_impl.c
+++ /dev/null
@@ -1,35 +0,0 @@ 
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier:     BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP Implementation information
- */
-
-#ifndef ODP_IMPL_H_
-#define ODP_IMPL_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/version.h>
-
-#define  ODP_VERSION_IMPL 0
-#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
-
-const char *odp_version_impl_str(void)
-{
-	return ODP_VERSION_IMPL_STR;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/platform/linux-generic/odp_version.c b/platform/linux-generic/odp_version.c
index 0a57b5e..776f4da 100644
--- a/platform/linux-generic/odp_version.c
+++ b/platform/linux-generic/odp_version.c
@@ -9,9 +9,14 @@ 
 #endif
 
 #include <odp/api/version.h>
-#include <odp/plat/version_types.h>
+#include <odp/version.h>
 
 const char *odp_version_api_str(void)
 {
 	return ODP_VERSION_API_STR;
 }
+
+const char *odp_version_impl_str(void)
+{
+	return ODP_VERSION_IMPL_STR;
+}