mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
spa: split the callback version check into a separate macro
This commit is contained in:
parent
264141b31b
commit
6bf1f9a694
1 changed files with 4 additions and 1 deletions
|
|
@ -132,8 +132,11 @@ struct spa_callbacks {
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Check if a callback \a c is of at least version \a v */
|
||||||
|
#define SPA_CALLBACK_VERSION_MIN(c,v) ((c) && ((v) == 0 || (c)->version > (v)-1))
|
||||||
|
|
||||||
/** Check if a callback \a c has method \a m of version \a v */
|
/** Check if a callback \a c has method \a m of version \a v */
|
||||||
#define SPA_CALLBACK_CHECK(c,m,v) ((c) && ((v) == 0 || (c)->version > (v)-1) && (c)->m)
|
#define SPA_CALLBACK_CHECK(c,m,v) (SPA_CALLBACK_VERSION_MIN(c,v) && (c)->m)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the set of functions \a funcs as a \ref spa_callbacks, together
|
* Initialize the set of functions \a funcs as a \ref spa_callbacks, together
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue