5 #ifndef SPA_UTILS_RESULT_H
6 #define SPA_UTILS_RESULT_H
26 #ifndef SPA_API_RESULT
28 #define SPA_API_RESULT SPA_API_IMPL
30 #define SPA_API_RESULT static inline
35 #define SPA_ASYNC_BIT (1 << 30)
36 #define SPA_ASYNC_SEQ_MASK (SPA_ASYNC_BIT - 1)
37 #define SPA_ASYNC_MASK (~SPA_ASYNC_SEQ_MASK)
39 #define SPA_RESULT_IS_OK(res) ((res) >= 0)
40 #define SPA_RESULT_IS_ERROR(res) ((res) < 0)
41 #define SPA_RESULT_IS_ASYNC(res) (((res) & SPA_ASYNC_MASK) == SPA_ASYNC_BIT)
43 #define SPA_RESULT_ASYNC_SEQ(res) ((res) & SPA_ASYNC_SEQ_MASK)
44 #define SPA_RESULT_RETURN_ASYNC(seq) (SPA_ASYNC_BIT | SPA_RESULT_ASYNC_SEQ(seq))
51 return strerror(_err);
SPA_API_RESULT const char * spa_strerror(int err)
Definition: result.h:61
#define SPA_API_RESULT
Definition: result.h:37
#define SPA_RESULT_IS_ASYNC(res)
Definition: result.h:54