mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-06 08:08:05 +02:00
Merge branch 'alignof' into 'master'
Define _DBUS_ALIGNOF using _Alignof when using C11 or newer See merge request dbus/dbus!389
This commit is contained in:
commit
cca6c04637
1 changed files with 4 additions and 0 deletions
|
|
@ -201,8 +201,12 @@ void _dbus_real_assert_not_reached (const char *explanation,
|
|||
((intptr_t) ((unsigned char*) &((struct_type*) 0)->member))
|
||||
#endif
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
|
||||
#define _DBUS_ALIGNOF(type) _Alignof(type)
|
||||
#else
|
||||
#define _DBUS_ALIGNOF(type) \
|
||||
(_DBUS_STRUCT_OFFSET (struct { char _1; type _2; }, _2))
|
||||
#endif
|
||||
|
||||
#if defined(DBUS_DISABLE_CHECKS) || defined(DBUS_DISABLE_ASSERT)
|
||||
/* this is an assert and not an error, but in the typical --disable-checks case (you're trying
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue