projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d51e31a
)
macro: add macro for determining size of struct with trailing union
author
Lennart Poettering
<lennart@poettering.net>
Fri, 10 Feb 2023 16:56:30 +0000
(17:56 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 17 Feb 2023 09:09:30 +0000
(10:09 +0100)
src/basic/macro.h
patch
|
blob
|
history
diff --git
a/src/basic/macro.h
b/src/basic/macro.h
index 25e42db0b6bfc413fa67cc11b0821992dd8434ba..ddf3032fbc767a976cd2056cc9608917f9d638b5 100644
(file)
--- a/
src/basic/macro.h
+++ b/
src/basic/macro.h
@@
-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. */