From e34f2106597b7c57c79bfd27c122efbdac083161 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" Date: Tue, 7 Jul 2020 09:12:25 -0400 Subject: [PATCH] Resolve #531, add development build number to version.h Add build number and baseline macros Add codename to version string Add macro for version strings --- src/os/inc/osapi-version.h | 57 +++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/src/os/inc/osapi-version.h b/src/os/inc/osapi-version.h index e90b4aa2a..bd25fff3b 100644 --- a/src/os/inc/osapi-version.h +++ b/src/os/inc/osapi-version.h @@ -23,19 +23,62 @@ * * Purpose: * The OSAL version numbers + * See cfe documentation for version and build number descriptions */ #ifndef _osapi_version_h_ #define _osapi_version_h_ -#define OS_MAJOR_VERSION 5 /**< @brief Major version number */ -#define OS_MINOR_VERSION 0 /**< @brief Minor version number */ -#define OS_REVISION 21 /**< @brief Revision number */ -#define OS_MISSION_REV 0 /**< @brief Mission revision */ +/* Development Build Macro Definitions */ +#define OS_BUILD_NUMBER 233 +#define OS_BUILD_BASELINE "v5.0.0+dev" -/** - * Combine the revision components into a single value that application code can check against - * e.g. "#if OSAL_API_VERSION >= 40100" would check if some feature added in OSAL 4.1 is present. +/* Version Macro Definitions +* ONLY APPLY for OFFICIAL release builds +*/ +#define OS_MAJOR_VERSION 5 /**< @brief Major version number */ +#define OS_MINOR_VERSION 0 /**< @brief Minor version number */ +#define OS_REVISION 0 /**< @brief Revision number */ +#define OS_MISSION_REV 0 /**< @brief Mission revision */ + +/* Helper functions to concatenate integer macro definitions into a string */ +#define OS_STR_HELPER(x) #x +#define OS_STR(x) OS_STR_HELPER(x) + +/* Development Build format for OS_VERSION */ +/* Baseline git tag + Number of commits since baseline */ +#define OS_VERSION OS_BUILD_BASELINE OS_STR(OS_BUILD_NUMBER) + +/* Development Build format for OS_VERSION_STRING */ +#define OS_VERSION_STRING \ + " OSAL Development Build\n" \ + " " OS_VERSION " (Codename: Bootes)\n" /* Codename for current development */ \ + " Latest Official Version: osal v5.0.0" /* For full support please use official release version */ + +/* Use the following templates for Official Releases ONLY */ + +/* Official Release format for OS_VERSION */ + /* + #define OS_VERSION "v" \ + OS_STR(OS_MAJOR_VERSION) "." \ + OS_STR(OS_MINOR_VERSION) "." \ + OS_STR(OS_REVISION) "." \ + OS_STR(OS_MISSION_REV) + */ + + /* Official Release OS_VERSION_STRING Format */ + /* + #define OS_VERSION_STRING " OSAL " OS_VERSION + */ + +/* END TEMPLATES */ + + +/* + * Combine the revision components into a single value that application code can +check against + * e.g. "#if OSAL_API_VERSION >= 40100" would check if some feature added in +OSAL 4.1 is present. */ #define OSAL_API_VERSION ((OS_MAJOR_VERSION * 10000) + (OS_MINOR_VERSION * 100) + OS_REVISION)