efi: add poor man's offsetof() implementation

This commit is contained in:
Lennart Poettering
2018-10-16 16:44:34 +02:00
parent d10ba83a1b
commit b73acaed42
+1
View File
@@ -5,6 +5,7 @@
#include <efilib.h>
#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";