aboutsummaryrefslogtreecommitdiff
path: root/sxiv.h
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-01-30 16:39:16 +0100
committerBert <ber.t@gmx.com>2011-01-30 16:39:16 +0100
commit03bfe1015e7e67104c2872bdcf085b1315b24a4c (patch)
tree4ec7420d3fe84106bb37e4329af92aca9b041543 /sxiv.h
parente2d9463375db0ba0ac1bb62c1573715c3a084346 (diff)
Explicitly enable printing of warnings
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();