From e9fe2aeba2d6174122c167e0617942c86d6ba83b Mon Sep 17 00:00:00 2001 From: Thong Thai Date: Wed, 8 Apr 2026 15:59:13 +0000 Subject: [PATCH] util: allow for overriding u_stub tail This commit allows for overriding the normal u_stub's TAIL implementation (returning -1) with a custom implementation, allowing for different TAIL implementations to be added without having to create a new TAIL+ in u_stub.h. Signed-off-by: Thong Thai Reviewed-by: David Rosca Part-of: --- src/util/u_stub.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/util/u_stub.h b/src/util/u_stub.h index 9d3a833add4..c6f23650f88 100644 --- a/src/util/u_stub.h +++ b/src/util/u_stub.h @@ -11,6 +11,14 @@ * #define __U_STUB__ * #endif * #include "u_stub.h" + * + * To override TAIL, define __U_STUB__TAIL before including u_stub.h, for example: + * + * #define __U_STUB__TAIL { return VA_STATUS_ERROR_UNIMPLEMENTED; } + * #ifndef HAVE_XXXX + * #define __U_STUB__ + * #endif + * #include "u_stub.h" * */ @@ -24,10 +32,15 @@ #ifdef __U_STUB__ #define MESAPROC static inline + +#ifdef __U_STUB__TAIL +#define TAIL __U_STUB__TAIL +#else #define TAIL \ { \ return -1; \ } +#endif #define TAILZ \ { \ return 0; \