mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 17:27:33 -04:00
Add ISC_{LIST,LINK}_INITIALIZER for designated initializers
Since we are using designated initializers, we were missing initializers
for ISC_LIST and ISC_LINK, add them, so you can do
*foo = (foo_t){ .list = ISC_LIST_INITIALIZER };
Instead of:
*foo = (foo_t){ 0 };
ISC_LIST_INIT(foo->list);
(cherry picked from commit cb3c36b8bf)
This commit is contained in:
parent
c6270cefb2
commit
8efe60d423
1 changed files with 10 additions and 0 deletions
|
|
@ -15,6 +15,16 @@
|
|||
|
||||
#include <isc/assertions.h>
|
||||
|
||||
#define ISC_LIST_INITIALIZER \
|
||||
{ \
|
||||
.head = NULL, .tail = NULL, \
|
||||
}
|
||||
#define ISC_LINK_INITIALIZER_TYPE(type) \
|
||||
{ \
|
||||
.prev = (type *)-1, .next = (type *)-1, \
|
||||
}
|
||||
#define ISC_LINK_INITIALIZER ISC_LINK_INITIALIZER_TYPE(void)
|
||||
|
||||
#ifdef ISC_LIST_CHECKINIT
|
||||
#define ISC_LINK_INSIST(x) ISC_INSIST(x)
|
||||
#else /* ifdef ISC_LIST_CHECKINIT */
|
||||
|
|
|
|||
Loading…
Reference in a new issue