util: use STATIC_ASSERT instead of static_assert
authorTapani Pälli <tapani.palli@intel.com>
Wed, 9 Nov 2016 06:58:12 +0000 (08:58 +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/util/u_vector.h

index 8fa4ec483c942382ae35caea63830f370f0d8a09..f97a8b43caeade49fd3c3ca6838178862f634888 100644 (file)
@@ -82,7 +82,7 @@ u_vector_finish(struct u_vector *queue)
 }
 
 #define u_vector_foreach(elem, queue)                                  \
-   static_assert(__builtin_types_compatible_p(__typeof__(queue), struct u_vector *), ""); \
+   STATIC_ASSERT(__builtin_types_compatible_p(__typeof__(queue), struct u_vector *)); \
    for (uint32_t __u_vector_offset = (queue)->tail;                                \
         elem = (queue)->data + (__u_vector_offset & ((queue)->size - 1)), __u_vector_offset < (queue)->head; \
         __u_vector_offset += (queue)->element_size)