[Mesa-dev] [PATCH 1/4] util: use STATIC_ASSERT instead of static_assert
Tapani Pälli
tapani.palli at intel.com
Thu Nov 10 09:33:50 UTC 2016
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 at intel.com>
---
src/util/u_vector.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/u_vector.h b/src/util/u_vector.h
index 8fa4ec4..f97a8b4 100644
--- a/src/util/u_vector.h
+++ b/src/util/u_vector.h
@@ -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)
--
2.7.4
More information about the mesa-dev
mailing list