DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] lib: set version 1.2.3r2 and more helper macros
Date: Tue,  7 May 2013 17:30:44 +0200	[thread overview]
Message-ID: <1367940644-13357-1-git-send-email-thomas.monjalon@6wind.com> (raw)

Applications can test versions, for compatibility, this way:
	#if RTE_VERSION >= RTE_VERSION_NUM(1,2,3,4)
Previous versions can be tested with:
	#ifndef RTE_VERSION_NUM

RTE_VERSION was already defined for use with rte_config.
It is moved in rte_version.h and updated to current version number.

Note that the first tag having this helper will be 1.2.3r2.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 lib/librte_eal/common/include/rte_eal.h     |    1 -
 lib/librte_eal/common/include/rte_version.h |   17 +++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index 58fa1cc..9aa5de8 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -50,7 +50,6 @@
 extern "C" {
 #endif
 
-#define RTE_VERSION 1 /**< The version of the RTE configuration structure. */
 #define RTE_MAGIC 19820526 /**< Magic number written by the main partition when ready. */
 
 /**
diff --git a/lib/librte_eal/common/include/rte_version.h b/lib/librte_eal/common/include/rte_version.h
index b29c1d3..0ef475f 100644
--- a/lib/librte_eal/common/include/rte_version.h
+++ b/lib/librte_eal/common/include/rte_version.h
@@ -63,10 +63,22 @@ extern "C" {
  */
 #define RTE_VER_PATCH_LEVEL 3
 
+/**
+ * Patch release number i.e. the w in x.y.zrw
+ */
+#define RTE_VER_PATCH_RELEASE 2
+
+#define RTE_VERSION_NUM(a,b,c,d) ((a) << 24 | (b) << 16 | (c) << 8 | (d))
+#define RTE_VERSION RTE_VERSION_NUM( \
+			RTE_VER_MAJOR, \
+			RTE_VER_MINOR, \
+			RTE_VER_PATCH_LEVEL, \
+			RTE_VER_PATCH_RELEASE)
+
 #define RTE_VER_PREFIX "RTE"
 
 /**
- * Function returning string of version number: "RTE x.y.z"
+ * Function returning string of version number: "RTE x.y.zrw"
  * @return
  *     string
  */
@@ -75,7 +87,8 @@ rte_version(void) {
 	return RTE_VER_PREFIX" "
 			RTE_STR(RTE_VER_MAJOR)"."
 			RTE_STR(RTE_VER_MINOR)"."
-			RTE_STR(RTE_VER_PATCH_LEVEL);
+			RTE_STR(RTE_VER_PATCH_LEVEL)"r"
+			RTE_STR(RTE_VER_PATCH_RELEASE);
 }
 
 #ifdef __cplusplus
-- 
1.7.10.4

             reply	other threads:[~2013-05-07 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07 15:30 Thomas Monjalon [this message]
2013-05-17  9:12 ` Olivier MATZ
2013-05-17 14:46   ` Thomas Monjalon
2013-05-17 15:02     ` Olivier MATZ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1367940644-13357-1-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).