mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
macro: introduce PA_INT_TYPE_MIN, PA_INT_TYPE_MAX, PA_INT_TYPE_SIGNED macros
This commit is contained in:
parent
fb4a2a1bbb
commit
56f217f3f8
1 changed files with 12 additions and 0 deletions
|
|
@ -304,6 +304,18 @@ typedef int pa_bool_t;
|
|||
#define pa_memzero(x,l) (memset((x), 0, (l)))
|
||||
#define pa_zero(x) (pa_memzero(&(x), sizeof(x)))
|
||||
|
||||
#define PA_INT_TYPE_SIGNED(type) (!!((type) 0 > (type) -1))
|
||||
|
||||
#define PA_INT_TYPE_MAX(type) \
|
||||
((type) (PA_INT_TYPE_SIGNED(type) \
|
||||
? ~(~(type) 0 << (8*sizeof(type)-1)) \
|
||||
: (type) -1))
|
||||
|
||||
#define PA_INT_TYPE_MIN(type) \
|
||||
((type) (PA_INT_TYPE_SIGNED(type) \
|
||||
? (~(type) 0 << (8*sizeof(type)-1)) \
|
||||
: (type) 0))
|
||||
|
||||
/* We include this at the very last place */
|
||||
#include <pulsecore/log.h>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue