From 4646451100d1d2f0761c6684480145a2709e9c2d Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 21 Apr 2024 01:07:14 -0400 Subject: [PATCH] libsupport: fix sort_r.h to work on FreeBSD 14 FreeBSD 14 has changed the definition of qsort_r to align it with the POSIX, but it did this with a #define. So when sort_r.h tries to provide a function prototype, surround the function name with parenthesis so it doesn't get expanded by FreeBSD's #define. Signed-off-by: Theodore Ts'o --- lib/support/sort_r.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/support/sort_r.h b/lib/support/sort_r.h index 8473ca8..660294e 100644 --- a/lib/support/sort_r.h +++ b/lib/support/sort_r.h @@ -267,7 +267,7 @@ static _SORT_R_INLINE void sort_r_simple(void *base, size_t nel, size_t w, #if defined _SORT_R_GNU typedef int(* __compar_d_fn_t)(const void *, const void *, void *); - extern void qsort_r(void *base, size_t nel, size_t width, + extern void (qsort_r)(void *base, size_t nel, size_t width, __compar_d_fn_t __compar, void *arg) __attribute__((nonnull (1, 4))); -- 1.8.3.1