mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: add SPA_ABS helper macro
This commit is contained in:
parent
23edb9ab2a
commit
1c3802bd82
1 changed files with 5 additions and 0 deletions
|
|
@ -120,6 +120,11 @@ struct spa_fraction {
|
|||
#define SPA_FOR_EACH_ELEMENT(arr, ptr) \
|
||||
for (ptr = arr; (void*)ptr < SPA_PTROFF(arr, sizeof(arr), void); ptr++)
|
||||
|
||||
#define SPA_ABS(a) \
|
||||
({ \
|
||||
__typeof__(a) _a = (a); \
|
||||
SPA_LIKELY(_a >= 0) ? _a : -_a; \
|
||||
})
|
||||
#define SPA_MIN(a,b) \
|
||||
({ \
|
||||
__typeof__(a) _min_a = (a); \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue