Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From e965e748c7030df0709e63128db2f023540a06ba Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 12 Sep 2015 18:53:31 +0000 |
| 4 | Subject: [PATCH 03/19] comparison_fn_t is glibc specific, use raw signature in |
| 5 | function pointer |
| 6 | |
| 7 | make it work with musl where comparison_fn_t is not provided |
| 8 | |
| 9 | Upstream-Status: Inappropriate [musl specific] |
| 10 | |
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 12 | --- |
| 13 | src/basic/util.h | 4 ++-- |
| 14 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 15 | |
| 16 | diff --git a/src/basic/util.h b/src/basic/util.h |
| 17 | index 40eaf518c..c58392397 100644 |
| 18 | --- a/src/basic/util.h |
| 19 | +++ b/src/basic/util.h |
| 20 | @@ -77,7 +77,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size, |
| 21 | * that only if nmemb > 0. |
| 22 | */ |
| 23 | static inline void* bsearch_safe(const void *key, const void *base, |
| 24 | - size_t nmemb, size_t size, comparison_fn_t compar) { |
| 25 | + size_t nmemb, size_t size, int (*compar)(const void *, const void *)) { |
| 26 | if (nmemb <= 0) |
| 27 | return NULL; |
| 28 | |
| 29 | @@ -89,7 +89,7 @@ static inline void* bsearch_safe(const void *key, const void *base, |
| 30 | * Normal qsort requires base to be nonnull. Here were require |
| 31 | * that only if nmemb > 0. |
| 32 | */ |
| 33 | -static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) { |
| 34 | +static inline void qsort_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) { |
| 35 | if (nmemb <= 1) |
| 36 | return; |
| 37 | |
| 38 | -- |
| 39 | 2.11.0 |
| 40 | |