summaryrefslogtreecommitdiffstats
path: root/src/boot
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-10-18 17:10:42 +0200
committerLennart Poettering <lennart@poettering.net>2018-10-18 19:01:54 +0200
commit0fef9583615435d41a7724b0c49f530433b4c572 (patch)
treedbb23fb6c2b777a44996dad8a398120683264e52 /src/boot
parentMerge pull request #10239 from yuwata/sd-device-monitor (diff)
downloadsystemd-0fef9583615435d41a7724b0c49f530433b4c572.tar.xz
systemd-0fef9583615435d41a7724b0c49f530433b4c572.zip
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
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/efi/util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h
index 40ede66d4a..daa386b769 100644
--- a/src/boot/efi/util.h
+++ b/src/boot/efi/util.h
@@ -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";