23 lines
551 B
C
23 lines
551 B
C
#ifndef VOIDNSRUN_MACROS_H
|
|
#define VOIDNSRUN_MACROS_H
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
extern bool g_verbose;
|
|
|
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
|
#define UNUSED(x) (void)(x)
|
|
#define ERROR(f_, ...) fprintf(stderr, (f_), ##__VA_ARGS__)
|
|
#define DEBUG(f_, ...) if (g_verbose) { \
|
|
fprintf(stderr, "debug: "); \
|
|
fprintf(stderr, (f_), ##__VA_ARGS__); \
|
|
}
|
|
|
|
#define ERROR_EXIT(f_, ...) { \
|
|
fprintf(stderr, (f_), ##__VA_ARGS__); \
|
|
goto end; \
|
|
}
|
|
|
|
#endif //VOIDNSRUN_MACROS_H
|