mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
macro: add macro for determining size of struct with trailing union
This commit is contained in:
@@ -248,6 +248,7 @@ static inline int __coverity_check_and_return__(int condition) {
|
||||
#define char_array_0(x) x[sizeof(x)-1] = 0;
|
||||
|
||||
#define sizeof_field(struct_type, member) sizeof(((struct_type *) 0)->member)
|
||||
#define endoffsetof_field(struct_type, member) (offsetof(struct_type, member) + sizeof_field(struct_type, member))
|
||||
|
||||
/* Returns the number of chars needed to format variables of the specified type as a decimal string. Adds in
|
||||
* extra space for a negative '-' prefix for signed types. Includes space for the trailing NUL. */
|
||||
|
||||
Reference in New Issue
Block a user