anv: use STATIC_ASSERT instead of static_assert
authorTapani Pälli <tapani.palli@intel.com>
Wed, 9 Nov 2016 07:02:39 +0000 (09:02 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Fri, 11 Nov 2016 05:59:29 +0000 (07:59 +0200)
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>
src/intel/vulkan/anv_private.h

index 2cd487afff9c6fcfcfbe3018ca8e0f360c5eb91a..30deb02e1da59b17928e3a8e92a5a03ef9ad2c2f 100644 (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];                           \