try_stderrcode

This commit is contained in:
Timerix 2025-08-10 21:33:16 +03:00
parent 8eeaff4245
commit bf56984482

View File

@ -85,3 +85,10 @@ typedef struct Result_ {
Error_printAndExit(_rname(N).error);\
};\
} while(0)
#define try_stderrcode(CALL) do {\
int r = CALL;\
if(r != 0){\
Return RESULT_ERROR(strerror(r), false);\
}\
} while(0)