aboutsummaryrefslogtreecommitdiff
path: root/sxiv.h
diff options
context:
space:
mode:
Diffstat (limited to 'sxiv.h')
-rw-r--r--sxiv.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/sxiv.h b/sxiv.h
index 837ae73..15db96e 100644
--- a/sxiv.h
+++ b/sxiv.h
@@ -20,26 +20,29 @@
#define SXIV_H
#include "config.h"
+#include "options.h"
#define ABS(a) ((a) < 0 ? (-(a)) : (a))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#define WARN(...) \
- do { \
- fprintf(stderr, "sxiv: %s:%d: warning: ", __FILE__, __LINE__); \
- fprintf(stderr, __VA_ARGS__); \
- fprintf(stderr, "\n"); \
- } while (0)
+#define WARN(...) \
+ do { \
+ if (options->warn) { \
+ fprintf(stderr, "sxiv: %s:%d: warning: ", __FILE__, __LINE__); \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, "\n"); \
+ } \
+ } while (0)
-#define DIE(...) \
- do { \
- fprintf(stderr, "sxiv: %s:%d: error: ", __FILE__, __LINE__); \
- fprintf(stderr, __VA_ARGS__); \
- fprintf(stderr, "\n"); \
- cleanup(); \
- exit(1); \
- } while (0)
+#define DIE(...) \
+ do { \
+ fprintf(stderr, "sxiv: %s:%d: error: ", __FILE__, __LINE__); \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, "\n"); \
+ cleanup(); \
+ exit(1); \
+ } while (0)
void cleanup();