From 6df5511c63edc75644d0a9d0f94f9eed79e9ab7f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 21 Mar 2017 11:51:15 +0200 Subject: utils: add EXIT_IF --- kms++util/inc/kms++util/kms++util.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kms++util') 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); \ + } -- cgit v1.2.3