summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-04-07 23:58:27 +0200
committerGitHub <noreply@github.com>2019-04-07 23:58:27 +0200
commitf14328bf0a420dd4e9b4500023a9ae2493eaab08 (patch)
tree5e1e2659476e1465cff39fee3d6e2262040e7c97 /src/common
parentMerge pull request #2355 from ReinUsesLisp/sync-point (diff)
parentPermit a Null Shader in case of a bad host_ptr. (diff)
downloadyuzu-f14328bf0a420dd4e9b4500023a9ae2493eaab08.tar
yuzu-f14328bf0a420dd4e9b4500023a9ae2493eaab08.tar.gz
yuzu-f14328bf0a420dd4e9b4500023a9ae2493eaab08.tar.bz2
yuzu-f14328bf0a420dd4e9b4500023a9ae2493eaab08.tar.lz
yuzu-f14328bf0a420dd4e9b4500023a9ae2493eaab08.tar.xz
yuzu-f14328bf0a420dd4e9b4500023a9ae2493eaab08.tar.zst
yuzu-f14328bf0a420dd4e9b4500023a9ae2493eaab08.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/assert.h18
1 files changed, 18 insertions, 0 deletions
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)