Package version up to 4.1.31
[platform/core/uifw/libtbm.git] / include / tbm_log.h
index 9f724cc..94d6e78 100644 (file)
@@ -116,19 +116,43 @@ void tbm_log_print_stdout(int level, const char *fmt, ...);
 /* check condition */
 #define TBM_RETURN_IF_FAIL(cond) {\
        if (!(cond)) {\
-               TBM_ERR("'%s' failed.\n", #cond);\
+               TBM_ERR("'%s' failed.", #cond);\
                return;\
        } \
 }
 #define TBM_RETURN_VAL_IF_FAIL(cond, val) {\
        if (!(cond)) {\
-               TBM_ERR("'%s' failed.\n", #cond);\
+               TBM_ERR("'%s' failed.", #cond);\
                return val;\
        } \
 }
 #define TBM_GOTO_VAL_IF_FAIL(cond, val) {\
        if (!(cond)) {\
-               TBM_ERR("'%s' failed.\n", #cond);\
+               TBM_ERR("'%s' failed.", #cond);\
+               goto val;\
+       } \
+}
+
+#define TBM_RETURN_SET_ERR_IF_FAIL(cond, error, error_type) {\
+       if (!(cond)) {\
+               TBM_ERR("'%s' failed.", #cond);\
+               error = error_type;\
+               return;\
+       } \
+}
+
+#define TBM_RETURN_VAL_SET_ERR_IF_FAIL(cond, val, error, error_type) {\
+       if (!(cond)) {\
+               TBM_ERR("'%s' failed.", #cond);\
+               error = error_type;\
+               return val;\
+       } \
+}
+
+#define TBM_GOTO_VAL_SET_ERR_IF_FAIL(cond, val, error, error_type) {\
+       if (!(cond)) {\
+               TBM_ERR("'%s' failed.", #cond);\
+               error = error_type;\
                goto val;\
        } \
 }