You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
377 B
C

#pragma once
#include <stdio.h>
#define LOG_ERR(FMT_STR, ...) do { \
fprintf(stderr, FMT_STR "\n" __VA_OPT__(,) __VA_ARGS__); \
} while (0)
#define FAIL_WITH(RET, FMT_STR, ...) do { \
LOG_ERR(FMT_STR, __VA_ARGS__); \
return (RET); \
} while (0)
#define FAIL(FMT_STR, ...) FAIL_WITH(-1, FMT_STR, __VA_ARGS__)