sd-id128: add SD_ID128_MAKE_UUID_STR

It's like SD_ID128_MAKE_STR, but with hyphens.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-06-15 22:01:39 +02:00
parent 8156422c8f
commit 7c7683f36c
3 changed files with 11 additions and 4 deletions
+3
View File
@@ -107,6 +107,9 @@ int sd_id128_get_boot_app_specific(sd_id128_t app_id, sd_id128_t *ret);
#define SD_ID128_MAKE_STR(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \
#a #b #c #d #e #f #g #h #i #j #k #l #m #n #o #p
#define SD_ID128_MAKE_UUID_STR(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \
#a #b #c #d "-" #e #f "-" #g #h "-" #i #j "-" #k #l #m #n #o #p
_sd_pure_ static __inline__ int sd_id128_equal(sd_id128_t a, sd_id128_t b) {
return memcmp(&a, &b, 16) == 0;
}