mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
utils: add some more helpers
This commit is contained in:
parent
b6500bcb80
commit
6f5a2701f3
2 changed files with 7 additions and 0 deletions
|
|
@ -172,6 +172,12 @@ struct spa_fraction {
|
|||
} \
|
||||
} while (false)
|
||||
|
||||
#define spa_assert_not_reached() \
|
||||
do { \
|
||||
fprintf(stderr, "Code should not be reached at %s:%u %s()", \
|
||||
__FILE__, __LINE__, __func__); \
|
||||
abort(); \
|
||||
} while (false)
|
||||
|
||||
/* Does exactly nothing */
|
||||
#define spa_nop() do {} while (false)
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ struct spa_dict {
|
|||
};
|
||||
|
||||
#define SPA_DICT_INIT(items,n_items) (struct spa_dict) { items, n_items }
|
||||
#define SPA_DICT_INIT_ARRAY(items) (struct spa_dict) { items, SPA_N_ELEMENTS(items) }
|
||||
|
||||
#define spa_dict_for_each(item, dict) \
|
||||
for ((item) = (dict)->items; \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue