mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +02:00
amd/addrlib: Use alternative ADDR_C_ASSERT definition.
Copied from mesa util/macros.h Avoids unused-local-typedef warnings. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13164>
This commit is contained in:
parent
d14cc308f9
commit
7b06b6288c
1 changed files with 7 additions and 1 deletions
|
|
@ -184,7 +184,13 @@
|
|||
#if defined(static_assert)
|
||||
#define ADDR_C_ASSERT(__e) static_assert(__e, "")
|
||||
#else
|
||||
#define ADDR_C_ASSERT(__e) typedef char __ADDR_C_ASSERT__[(__e) ? 1 : -1]
|
||||
/* This version of STATIC_ASSERT() relies on VLAs. If COND is
|
||||
* false/zero, the array size will be -1 and we'll get a compile
|
||||
* error
|
||||
*/
|
||||
# define ADDR_C_ASSERT(__e) do { \
|
||||
(void) sizeof(char [1 - 2*!(__e)]); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
namespace Addr
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue