[riot-notifications] [RIOT-OS/RIOT] build system: add machine-readable RIOT_VERSION_CODE macro (#16765)

Martine Lenders notifications at github.com
Tue Aug 24 14:50:43 CEST 2021


@miri64 commented on this pull request.



> @@ -187,6 +187,19 @@ extern "C" {
  */
 #define IS_USED(module) IS_ACTIVE(module)
 
+/**
+ * @def         KERNEL_VERSION(mayor, minor, patch)
+ * @brief       Generates a 64 bit variable of a release version
+ *              Comparisons to this only apply to released branches
+ *
+ * @param[in]   a   Mayor version of the release
+ * @param[in]   b   Minor version of the release
+ * @param[in]   c   Patch level of the release
+ *
+ * @returns     A machine readable version variable
+ */
+#define KERNEL_VERSION(a, b, c) (((uint64_t)(a) << 32) + ((b) << 16) + (c))

To we really need 16 bit for `b`? We do not use semantic versioning (and if we switch we need to have some other version hierarchy anyways), but the version is always comprised of a year and months. The year could be encoded in 16 bits (unless we assume RIOT will last until 656th century) and for the month even 4 bits suffice.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16765#pullrequestreview-737184156
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210824/db1b5789/attachment-0001.htm>


More information about the notifications mailing list