mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 11:20:11 +01:00
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>
This commit is contained in:
parent
3b20ca34ae
commit
b8e077daee
1 changed files with 4 additions and 0 deletions
|
|
@ -80,6 +80,10 @@ u_vector_finish(struct u_vector *queue)
|
||||||
free(queue->data);
|
free(queue->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __GNUC__
|
||||||
|
#define __builtin_types_compatible_p(x) 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define u_vector_foreach(elem, 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; \
|
for (uint32_t __u_vector_offset = (queue)->tail; \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue