diff options
author | Brian Paul <[email protected]> | 2019-03-29 10:45:44 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2019-03-29 15:33:43 -0600 |
commit | b8e077daee4d6369d774efaa99879a9871c68194 (patch) | |
tree | 6b7f9093b6b3c82739759799ffde70487edb9961 /src/util/u_vector.h | |
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 <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/util/u_vector.h')
-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; \ |