+
+#define TBM_SURFACE_RETURN_VAL_ERR_IF_FAIL(cond, val, error_type) {\
+ if (!(cond)) {\
+ TBM_ERR("'%s' failed.\n", #cond);\
+ _tbm_set_last_result(error_type);\
+ _tbm_surface_mutex_unlock();\
+ return val;\
+ } \
+}
+
+#define TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(cond, val, error, error_type) {\
+ if (!(cond)) {\
+ TBM_ERR("'%s' failed.\n", #cond);\
+ error = error_type;\
+ _tbm_set_last_result(error_type);\
+ _tbm_surface_mutex_unlock();\
+ return val;\
+ } \
+}
+