From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ea0-x232.google.com (mail-ea0-x232.google.com [IPv6:2a00:1450:4013:c01::232]) by dpdk.org (Postfix) with ESMTP id D0B0E6A22 for ; Tue, 7 May 2013 17:30:44 +0200 (CEST) Received: by mail-ea0-f178.google.com with SMTP id m14so403395eaj.9 for ; Tue, 07 May 2013 08:30:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer :x-gm-message-state; bh=O44mYdmEhrc0w1JVO3GAfSdlGt1pcd39Cz3BPLXmVq8=; b=SDMsE+CUBuhR/LAswAb/hZBPV3jOtTG6mM2ufXVMIFx55+WmLSjpJD2yHIqApIRzqc yhqZ36U6Y2pevYLAbgAjygW2swDsIzOM6EcsBDxFNeejW/nAykB6Mere/8KilkXyCDp7 3X0InDZORdzyf2cuM8Fwm4lUBl0QYPNCXunDKwG0LnZWBpL0aa/aJL8uchdjtYUaUGEg Ldy4S0bcK1gfsx7KdXPAYzJVljPQ95NJf6d7PbYsPG3HgrKMwtvoBknqHnbFH1VsRUCn rL/yCAIyRUGD1ImrFfBmgOjBpy4x/yx46NeaqxB5RnogPyMWpIgQZWef06LXA3B5vilJ V+ig== X-Received: by 10.15.95.74 with SMTP id bc50mr6337006eeb.36.1367940645074; Tue, 07 May 2013 08:30:45 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id c44sm36713407eeb.4.2013.05.07.08.30.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 07 May 2013 08:30:43 -0700 (PDT) Received: by 6wind.com (sSMTP sendmail emulation); Tue, 07 May 2013 17:30:44 +0200 From: Thomas Monjalon To: dev@dpdk.org Date: Tue, 7 May 2013 17:30:44 +0200 Message-Id: <1367940644-13357-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmlYcqb+5wtjQsZzlt8mbTLJyY/hnN3/aXkExgUhRj8zkLgjILZMzaJbldO6lAujDcZqOt3 Subject: [dpdk-dev] [PATCH] lib: set version 1.2.3r2 and more helper macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 15:30:45 -0000 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 --- 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