Print the argument return value in QPMS_ENSURE_SUCCESS.
Former-commit-id: 2aa9742b6bb1a10b963a197419af7ef57b7999c1
This commit is contained in:
parent
32c9c2a434
commit
947f499bbf
|
@ -82,7 +82,12 @@ qpms_dbgmsg_flags qpms_dbgmsg_enable(qpms_dbgmsg_flags types);
|
||||||
#define QPMS_PR_ERROR(msg, ...) qpms_pr_error_at_flf(__FILE__,__LINE__,__func__,msg, ##__VA_ARGS__)
|
#define QPMS_PR_ERROR(msg, ...) qpms_pr_error_at_flf(__FILE__,__LINE__,__func__,msg, ##__VA_ARGS__)
|
||||||
|
|
||||||
// TODO replace this macro with an inline function?
|
// TODO replace this macro with an inline function?
|
||||||
#define QPMS_ENSURE_SUCCESS(x) {if(x) QPMS_WTF;}
|
#define QPMS_ENSURE_SUCCESS(x) { \
|
||||||
|
int errorcode = (x); \
|
||||||
|
if(errorcode) \
|
||||||
|
qpms_pr_error_at_flf(__FILE__,__LINE__,__func__,"Unexpected error (%d)", errorcode); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define QPMS_ENSURE(x, msg, ...) {if(!(x)) qpms_pr_error_at_flf(__FILE__,__LINE__,__func__,msg, ##__VA_ARGS__); }
|
#define QPMS_ENSURE(x, msg, ...) {if(!(x)) qpms_pr_error_at_flf(__FILE__,__LINE__,__func__,msg, ##__VA_ARGS__); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue