diff options
Diffstat (limited to 'src/iutils/Utils.h')
| -rw-r--r-- | src/iutils/Utils.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/iutils/Utils.h b/src/iutils/Utils.h index 37396bf..388d017 100644 --- a/src/iutils/Utils.h +++ b/src/iutils/Utils.h @@ -127,6 +127,18 @@ typedef ::cros::V4L2Format V4L2Format; } \ } while (0) +/** + * Used to check input parameters, if unsuccessful, returns err_code and prints a log1 message, + * which applies to error checking without substance. + */ +#define CheckAndLog1(condition, err_code, err_msg, args...) \ + do { \ + if (condition) { \ + LOG1(err_msg, ##args); \ + return err_code; \ + } \ + } while (0) + // macro delete array and set it to null #define DELETE_ARRAY_AND_NULLIFY(var) \ do { \ |
