libpkgconf: add PKGCONF_ARRAY_SIZE() macro

pull/92/head
William Pitcock 2016-05-19 16:51:47 -05:00
parent c6676e9de4
commit 20d448abb8
1 changed files with 2 additions and 0 deletions

View File

@ -40,6 +40,8 @@ typedef struct pkgconf_dependency_ pkgconf_dependency_t;
typedef struct pkgconf_tuple_ pkgconf_tuple_t;
typedef struct pkgconf_fragment_ pkgconf_fragment_t;
#define PKGCONF_ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
#define PKGCONF_FOREACH_LIST_ENTRY(head, value) \
for ((value) = (head); (value) != NULL; (value) = (value)->next)