mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-11 06:20:17 +01:00
dbus-internals: add _DBUS_ALIGNOF
This is useful when making static assertions about our types' properties. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Thiago Macieira <thiago@kde.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94136
This commit is contained in:
parent
9abba2d935
commit
ca9ea25e11
1 changed files with 3 additions and 0 deletions
|
|
@ -195,6 +195,9 @@ extern const char *_dbus_return_if_fail_warning_format;
|
|||
#define _DBUS_STRUCT_OFFSET(struct_type, member) \
|
||||
((intptr_t) ((unsigned char*) &((struct_type*) 0)->member))
|
||||
|
||||
#define _DBUS_ALIGNOF(type) \
|
||||
(_DBUS_STRUCT_OFFSET (struct { char _1; type _2; }, _2))
|
||||
|
||||
#ifdef DBUS_DISABLE_CHECKS
|
||||
/* this is an assert and not an error, but in the typical --disable-checks case (you're trying
|
||||
* to really minimize code size), disabling these assertions makes sense.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue