summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-10-20 10:52:57 -0700
committerChad Versace <[email protected]>2015-10-20 10:55:54 -0700
commit855180b3d91d1749ca5d6bbf90534ed4e3bf47d1 (patch)
treea0f949d22c4ef6a7b7541309edea189708e8fb05
parent81f8b82fc866aeadcbedce12395605918c105317 (diff)
anv: Define anv_validate macro
If a block of code is annotated with anv_validate, then the block runs only in debug builds.
-rw-r--r--src/vulkan/anv_private.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h
index 68598a9dd49..f03620f92ec 100644
--- a/src/vulkan/anv_private.h
+++ b/src/vulkan/anv_private.h
@@ -164,6 +164,16 @@ void anv_loge_v(const char *format, va_list va);
#define anv_assert(x)
#endif
+/**
+ * If a block of code is annotated with anv_validate, then the block runs only
+ * in debug builds.
+ */
+#ifdef DEBUG
+#define anv_validate if (1)
+#else
+#define anv_validate if (0)
+#endif
+
void anv_abortf(const char *format, ...) anv_noreturn anv_printflike(1, 2);
void anv_abortfv(const char *format, va_list va) anv_noreturn;