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

Marian Buschsieweke notifications at github.com
Tue Sep 21 10:44:27 CEST 2021

@maribu commented on this pull request.

> +#define KERNEL_VERSION(a, b, c, d) (((uint64_t)(a) << 48) + ((uint64_t)(b) << 32) + \
+                                    ((uint64_t)(c) << 16) + (d))

> Is there a reason this is a macro (vs. static inline)?

There might be use cases where e.g. a newly introduced `struct` member should be used on newer versions, but cannot be used on older versions. Handling this will only work with the preprocessor to the best of my knowledge. Hence, it makes IMO sense to make this available to the preprocessor.

But I don't think that the C style casts used in the expression will actually allow us using it in the preprocessor anyway. So if the casts are going to stay, I would also prefer a C function over a macro.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210921/b5c7ed2a/attachment.htm>

More information about the notifications mailing list