From b73acaed42c85709ec0e9bc5b6c4511cba40a6ff Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 21 Jun 2018 18:49:52 +0200 Subject: [PATCH] efi: add poor man's offsetof() implementation --- src/boot/efi/util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h index 8a3e0520fc..3e6e610289 100644 --- a/src/boot/efi/util.h +++ b/src/boot/efi/util.h @@ -5,6 +5,7 @@ #include #define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0])) +#define OFFSETOF(x,y) ((UINTN) &(((x*)0)->y)) static inline const CHAR16 *yes_no(BOOLEAN b) { return b ? L"yes" : L"no";