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 <thong.thai@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40493>
This commit is contained in:
Thong Thai 2026-04-08 15:59:13 +00:00 committed by Marge Bot
parent f9df50eb31
commit e9fe2aeba2

View file

@ -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; \