summaryrefslogtreecommitdiffstats
path: root/src/util/u_vector.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2019-03-29 10:45:44 -0600
committerBrian Paul <[email protected]>2019-03-29 15:33:43 -0600
commitb8e077daee4d6369d774efaa99879a9871c68194 (patch)
tree6b7f9093b6b3c82739759799ffde70487edb9961 /src/util/u_vector.h
parent3b20ca34aeb9250b937166c7a499bd56d4c16289 (diff)
util: no-op __builtin_types_compatible_p() for non-GCC compilers
__builtin_types_compatible_p() is GCC-specific and breaks the MSVC build. This intrinsic has been in u_vector_foreach() for a long time, but that macro has only recently been used in code (nir/nir_opt_comparison_pre.c) that's built with MSVC. Fixes: 2cf59861a ("nir: Add partial redundancy elimination for compares") Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/util/u_vector.h')
-rw-r--r--src/util/u_vector.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/u_vector.h b/src/util/u_vector.h
index cd8a95dcbe3..6807748e3b1 100644
--- a/src/util/u_vector.h
+++ b/src/util/u_vector.h
@@ -80,6 +80,10 @@ u_vector_finish(struct u_vector *queue)
free(queue->data);
}
+#ifndef __GNUC__
+#define __builtin_types_compatible_p(x) 1
+#endif
+
#define u_vector_foreach(elem, queue) \
STATIC_ASSERT(__builtin_types_compatible_p(__typeof__(queue), struct u_vector *)); \
for (uint32_t __u_vector_offset = (queue)->tail; \