X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=api%2Fmraa%2Fcommon.h;h=ef67c49ebd098cca49effb20b0c3f1759c03a097;hb=759d387c5a8be8534b83d2ec875f66400d642871;hp=58afb82328a6e73a3de34deb619cb50c6eea78a7;hpb=ccafc77641b21672881e8f75fe44d017e5147402;p=contrib%2Fmraa.git diff --git a/api/mraa/common.h b/api/mraa/common.h index 58afb82..ef67c49 100644 --- a/api/mraa/common.h +++ b/api/mraa/common.h @@ -36,6 +36,13 @@ #define MRAA_MAIN_PLATFORM_OFFSET 0 #define MRAA_SUB_PLATFORM_OFFSET 1 +/** Executes function func and returns its result in case of error + */ +#define MRAA_RETURN_FOR_ERROR(func) do { \ + mraa_result_t res; \ + res = func; \ + if (res != MRAA_SUCCESS) \ + return res;} while(0) /** @file *