Browse Source

anv: use STATIC_ASSERT instead of static_assert

fixes following compilation warnings on Android build:

"warning: implicit declaration of function 'static_assert' is invalid in
C99 [-Wimplicit-function-declaration]"

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
tags/17.0-branchpoint
Tapani Pälli 9 years ago
parent
commit
23d1799f7d
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/intel/vulkan/anv_private.h

+ 2
- 2
src/intel/vulkan/anv_private.h View File

@@ -159,7 +159,7 @@ anv_clear_mask(uint32_t *inout_mask, uint32_t clear_mask)
__dword &= ~(1 << (b)))

#define typed_memcpy(dest, src, count) ({ \
static_assert(sizeof(*src) == sizeof(*dest), ""); \
STATIC_ASSERT(sizeof(*src) == sizeof(*dest)); \
memcpy((dest), (src), (count) * sizeof(*(src))); \
})

@@ -725,7 +725,7 @@ _anv_combine_address(struct anv_batch *batch, void *location,
do { \
uint32_t *dw; \
\
static_assert(ARRAY_SIZE(dwords0) == ARRAY_SIZE(dwords1), "mismatch merge"); \
STATIC_ASSERT(ARRAY_SIZE(dwords0) == ARRAY_SIZE(dwords1)); \
dw = anv_batch_emit_dwords((batch), ARRAY_SIZE(dwords0)); \
for (uint32_t i = 0; i < ARRAY_SIZE(dwords0); i++) \
dw[i] = (dwords0)[i] | (dwords1)[i]; \

Loading…
Cancel
Save