View | Details | Raw Unified | Return to bug 266227 | Differences between
and this patch

Collapse All | Expand All

(-)b/databases/ejdb/files/patch-src_util_sort__r.h (-1 / +34 lines)
Added Link Here
0
- 
1
--- src/util/sort_r.h.orig	2022-02-23 10:00:23 UTC
2
+++ src/util/sort_r.h
3
@@ -25,10 +25,11 @@
4
 #define _SORT_R_INLINE inline
5
 
6
 #if (  defined __APPLE__ || defined __MACH__ || defined __DARWIN__    \
7
-    || defined __FreeBSD__ || defined __DragonFly__) && defined JB_HAVE_QSORT_R
8
+    || (defined __FreeBSD__ && !defined(qsort_r)) || defined __DragonFly__) && defined JB_HAVE_QSORT_R
9
 #  define _SORT_R_BSD
10
 #elif (  defined _GNU_SOURCE || defined __gnu_hurd__ || defined __GNU__    \
11
-      || defined __linux__ || defined __MINGW32__ || defined __GLIBC__) && defined JB_HAVE_QSORT_R
12
+      || defined __linux__ || defined __MINGW32__ || defined __GLIBC__ \
13
+      || (defined (__FreeBSD__) && defined(qsort_r))) && defined JB_HAVE_QSORT_R
14
 #  define _SORT_R_LINUX
15
 #elif (defined _WIN32 || defined _WIN64 || defined __WINDOWS__)
16
 #  define _SORT_R_WINDOWS
17
@@ -255,7 +256,7 @@ static _SORT_R_INLINE void sort_r(
18
   #if defined _SORT_R_BSD
19
 
20
 /* Ensure qsort_r is defined */
21
-extern void qsort_r(
22
+extern void (qsort_r)(
23
   void *base, size_t nel, size_t width, void *thunk,
24
   int (*compar)(void *_thunk,
25
                 const void *_a, const void *_b));
26
@@ -283,7 +284,7 @@ typedef int (*__compar_d_fn_t)(const void*, const void
27
   #if defined _SORT_R_LINUX
28
 
29
 typedef int (*__compar_d_fn_t)(const void*, const void*, void*);
30
-extern void qsort_r(
31
+extern void (qsort_r)(
32
   void *base, size_t nel, size_t width,
33
   __compar_d_fn_t __compar, void *arg)
34
 __attribute__((nonnull(1, 4)));

Return to bug 266227