Commit bf7e4b1
committed
Use POSIX qsort_r on FreeBSD >= 14
Prior to FreeBSD, qsort_r's arguments were the original BSD style,
where the thunk was the first argument to the comparison function.
However, the GNU style, where the thunk was the last argument, was
eventually adopted as the POSIX standard. FreeBSD switched to this
beginning with FreeBSD 14.
So when compiling on FreeBSD, we first check to see whether to use the
BSD-style or GNU-style qsort_r declaration.
This patch is based on noporpoise/sort_r#151 parent e0c2a31 commit bf7e4b1
1 file changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
285 | | - | |
| 287 | + | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
| |||
0 commit comments