Skip to content

Commit

Permalink
libsupport: fix sort_r.h to work on FreeBSD 14
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tytso committed Apr 21, 2024
1 parent 4b81995 commit 4646451
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/support/sort_r.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)));

Expand Down

0 comments on commit 4646451

Please sign in to comment.