mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
pulse: various fixes and improvements
This commit is contained in:
parent
2254a124af
commit
a30722c442
5 changed files with 241 additions and 65 deletions
|
|
@ -108,19 +108,24 @@ static inline const char *pa_strnull(const char *x) {
|
|||
|
||||
int pa_context_set_error(pa_context *c, int error);
|
||||
|
||||
#define PA_CHECK_VALIDITY(context, expression, error) \
|
||||
do { \
|
||||
if (!(expression)) \
|
||||
return -pa_context_set_error((context), (error)); \
|
||||
} while(false)
|
||||
#define PA_CHECK_VALIDITY(context, expression, error) \
|
||||
do { \
|
||||
if (!(expression)) { \
|
||||
fprintf(stderr, "'%s' failed at %s:%u %s()", \
|
||||
#expression , __FILE__, __LINE__, __func__); \
|
||||
return -pa_context_set_error((context), (error)); \
|
||||
} \
|
||||
} while(false)
|
||||
|
||||
#define PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, value) \
|
||||
do { \
|
||||
if (!(expression)) { \
|
||||
pa_context_set_error((context), (error)); \
|
||||
return value; \
|
||||
} \
|
||||
} while(false)
|
||||
#define PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, value) \
|
||||
do { \
|
||||
if (!(expression)) { \
|
||||
fprintf(stderr, "'%s' failed at %s:%u %s()", \
|
||||
#expression , __FILE__, __LINE__, __func__); \
|
||||
pa_context_set_error((context), (error)); \
|
||||
return value; \
|
||||
} \
|
||||
} while(false)
|
||||
|
||||
#define PA_CHECK_VALIDITY_RETURN_NULL(context, expression, error) \
|
||||
PA_CHECK_VALIDITY_RETURN_ANY(context, expression, error, NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue