From 485505d5500b441d3d6d8ccb34489ab1c54be03d Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Tue, 22 Nov 2022 18:23:01 +0800 Subject: [PATCH] util: Fixes -Wundef in u_qsort.h Partial of: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7680 Signed-off-by: Yonggang Luo Reviewed-by: Eric Engestrom Part-of: --- src/util/u_qsort.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/u_qsort.h b/src/util/u_qsort.h index 454d3839863..afd6bfd1f87 100644 --- a/src/util/u_qsort.h +++ b/src/util/u_qsort.h @@ -56,10 +56,10 @@ util_qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *arg) { -#if HAVE_GNU_QSORT_R +#if defined(HAVE_GNU_QSORT_R) /* GNU extension added in glibc 2.8 */ qsort_r(base, nmemb, size, compar, arg); -#elif HAVE_BSD_QSORT_R +#elif defined(HAVE_BSD_QSORT_R) /* BSD/macOS qsort_r takes "arg" before the comparison function and it * pass the "arg" before the elements. */