diff options
Diffstat (limited to 'include/ps_debug_util.h')
-rwxr-xr-x | include/ps_debug_util.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/ps_debug_util.h b/include/ps_debug_util.h index bfdd5e3..4b064c4 100755 --- a/include/ps_debug_util.h +++ b/include/ps_debug_util.h @@ -81,6 +81,14 @@ }\ }while(0) +#define SEARCH_RETV_IF_WITH_ERRORV(cond,ret,errorv) \ + do {\ + if(cond) {\ + LOGW("\x1b[33m[%s() \t%s:%d][RET_IF]\x1b[0m error value = %d",__FUNCTION__, strrchr(__FILE__, '/')+1, __LINE__, errorv);\ + return ret;\ + }\ + }while(0) + #define SEARCH_RET_IF(cond) \ do {\ if(cond) {\ @@ -147,6 +155,14 @@ }\ }while(0) +#define SEARCH_RETV_IF_WITH_ERRORV(cond,ret,errorv) \ + do {\ + if(cond) {\ + fprintf(stderr, "[%s() \t%s:%d][RET_IF] error_value = %d",__FUNCTION__, strrchr(__FILE__, '/')+1, __LINE__, errorv);\ + return ret;\ + }\ + }while(0) + #define SEARCH_RET_IF(cond) \ do {\ if(cond) {\ @@ -175,6 +191,7 @@ #define SEARCH_DEBUG_ERROR(fmt, arg...) #define SEARCH_ASSERT_IF(cond) #define SEARCH_RETV_IF(cond,ret) +#define SEARCH_RETV_IF_WITH_ERRORV(cond,ret,errorv) #define SEARCH_RET_IF(cond) #define SEARCH_RET_IF_STR_INVALID(str,ret) |