diff options
author | Alexandru N. Onea <alexandru.onea@harman.com> | 2019-04-08 12:20:28 +0300 |
---|---|---|
committer | Alexandru N. Onea <alexandru.onea@harman.com> | 2019-04-08 12:20:28 +0300 |
commit | e62ceb5618c40cbc900d9ad4f664d658b2bd83b0 (patch) | |
tree | 3141034f18ff77689f78a051ca433ce40ddb8870 | |
parent | 52c1bf5fbdc4c9a47825a1da5e5b7340f35cef66 (diff) |
Generate final version string and number based on major, minor and patch
-rw-r--r-- | include/tinyalsa/version.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/include/tinyalsa/version.h b/include/tinyalsa/version.h index ae3fb5e..608511d 100644 --- a/include/tinyalsa/version.h +++ b/include/tinyalsa/version.h @@ -29,15 +29,30 @@ #ifndef TINYALSA_VERSION_H #define TINYALSA_VERSION_H +/* Macros for expanding the version numbers into string literals */ +#define TINYALSA_VERSION_STR_EX(number) #number +#define TINYALSA_VERSION_STR(number) TINYALSA_VERSION_STR_EX (number) + #define TINYALSA_VERSION_MAJOR 1 #define TINYALSA_VERSION_MINOR 1 #define TINYALSA_VERSION_PATCH 1 -#define TINYALSA_VERSION 0x010101UL - -#define TINYALSA_VERSION_STRING "1.1.1" +/* The final version number is constructed based on minor, major and patch */ +#define TINYALSA_VERSION \ + ((unsigned long) \ + ((TINYALSA_VERSION_MAJOR << 16) | \ + (TINYALSA_VERSION_MINOR << 8 ) | \ + (TINYALSA_VERSION_PATCH ))) + +/* The version string is constructed by concatenating individual ver. strings */ +#define TINYALSA_VERSION_STRING \ + TINYALSA_VERSION_STR (TINYALSA_VERSION_MAJOR) \ + "." \ + TINYALSA_VERSION_STR (TINYALSA_VERSION_MINOR) \ + "." \ + TINYALSA_VERSION_STR (TINYALSA_VERSION_PATCH) #endif /* TINYALSA_VERSION_H */ |