From: Theodore Ts'o Date: Sun, 21 Apr 2024 05:07:14 +0000 (-0400) Subject: libsupport: fix sort_r.h to work on FreeBSD 14 X-Git-Tag: v1.47.1-rc1~38 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=4646451100d1d2f0761c6684480145a2709e9c2d;p=tools%2Fe2fsprogs.git 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 --- 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)));