efi: rework OFFSETOF() based on __builtin_offsetof()
Since both LLVM and gcc supported this for a long time, we are not adding a fallback compat kludge. And even if there's some relevant compiler that doesn't know this concept, it'll fail with a compiler error, and we'll fix it then. As suggested by @keszybz: https://github.com/systemd/systemd/pull/10174#discussion_r226266540
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
#include <efilib.h>
|
||||
|
||||
#define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0]))
|
||||
#define OFFSETOF(x,y) ((UINTN) &(((x*)0)->y))
|
||||
#define OFFSETOF(x,y) __builtin_offsetof(x,y)
|
||||
|
||||
static inline const CHAR16 *yes_no(BOOLEAN b) {
|
||||
return b ? L"yes" : L"no";
|
||||
|
||||
Reference in New Issue
Block a user