From 28d34f63527982d6fd931ab424a91d8fe0ede8f9 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Fri, 19 Jan 2024 21:57:54 +0900 Subject: [PATCH] asahi: libagx: introduce AGX_STATIC_ASSERT Using the array size trick, this works in both OpenCL and C. Signed-off-by: Asahi Lina Part-of: --- src/asahi/lib/shaders/libagx.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/asahi/lib/shaders/libagx.h b/src/asahi/lib/shaders/libagx.h index dfed812fac8..6db8025bb97 100644 --- a/src/asahi/lib/shaders/libagx.h +++ b/src/asahi/lib/shaders/libagx.h @@ -30,4 +30,7 @@ uint32_t nir_stack_unmap_agx(uint16_t index); #endif +#define AGX_STATIC_ASSERT(_COND) \ + typedef char static_assertion_##__line__[(_COND) ? 1 : -1] + #endif