aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/tinyalsa/version.h21
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 */