summaryrefslogtreecommitdiff
path: root/kms++util/inc
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-03-21 11:51:15 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-03-21 11:51:15 +0200
commit6df5511c63edc75644d0a9d0f94f9eed79e9ab7f (patch)
treed5a7498534392f487ab8a8ede611b4ae26389ade /kms++util/inc
parent12ad56d1360d6140093f2871c32593751b8ae052 (diff)
utils: add EXIT_IF
Diffstat (limited to 'kms++util/inc')
-rw-r--r--kms++util/inc/kms++util/kms++util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/kms++util/inc/kms++util/kms++util.h b/kms++util/inc/kms++util/kms++util.h
index 3745a31..c1e3c8c 100644
--- a/kms++util/inc/kms++util/kms++util.h
+++ b/kms++util/inc/kms++util/kms++util.h
@@ -63,3 +63,9 @@ void draw_test_pattern(IMappedFramebuffer &fb);
fprintf(stderr, fmt "\n", ##__VA_ARGS__); \
exit(-1); \
} while(0)
+
+#define EXIT_IF(x, fmt, ...) \
+ if (unlikely(x)) { \
+ fprintf(stderr, fmt "\n", ##__VA_ARGS__); \
+ exit(-1); \
+ }