diff options
author | Bert <ber.t@gmx.com> | 2011-01-30 16:39:16 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-01-30 16:39:16 +0100 |
commit | 03bfe1015e7e67104c2872bdcf085b1315b24a4c (patch) | |
tree | 4ec7420d3fe84106bb37e4329af92aca9b041543 /sxiv.h | |
parent | e2d9463375db0ba0ac1bb62c1573715c3a084346 (diff) |
Explicitly enable printing of warnings
Diffstat (limited to 'sxiv.h')
-rw-r--r-- | sxiv.h | 31 |
1 files changed, 17 insertions, 14 deletions
@@ -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(); |