From 021cd56bc98aec220b85c2049e1edb5c02714294 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Wed, 27 Mar 2019 14:59:00 -0400 Subject: Permit a Null Shader in case of a bad host_ptr. --- src/common/assert.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/common/assert.h') diff --git a/src/common/assert.h b/src/common/assert.h index 6002f7ab1..4b0e3f64e 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -57,3 +57,21 @@ __declspec(noinline, noreturn) #define UNIMPLEMENTED_IF(cond) ASSERT_MSG(!(cond), "Unimplemented code!") #define UNIMPLEMENTED_IF_MSG(cond, ...) ASSERT_MSG(!(cond), __VA_ARGS__) + +// If the assert is ignored, execute _b_ +#define ASSERT_OR_EXECUTE(_a_, _b_) \ + do { \ + ASSERT(_a_); \ + if (!(_a_)) { \ + _b_ \ + } \ + } while (0) + +// If the assert is ignored, execute _b_ +#define ASSERT_OR_EXECUTE_MSG(_a_, _b_, ...) \ + do { \ + ASSERT_MSG(_a_, __VA_ARGS__); \ + if (!(_a_)) { \ + _b_ \ + } \ + } while (0) -- cgit v1.2.3