diff options
author | Brian Paul <brianp@vmware.com> | 2019-03-29 10:45:44 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2019-03-29 15:33:43 -0600 |
commit | b8e077daee4d6369d774efaa99879a9871c68194 (patch) | |
tree | 6b7f9093b6b3c82739759799ffde70487edb9961 | |
parent | 3b20ca34aeb9250b937166c7a499bd56d4c16289 (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 <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r-- | src/util/u_vector.h | 4 |
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; \ |