summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorKlaus Kämpf <kkaempf@suse.de>2011-02-03 15:36:05 +0100
committerKlaus Kämpf <kkaempf@suse.de>2011-02-03 15:36:05 +0100
commit12e4557bf5ebd32ca31e88ea54dfe0f217358ba7 (patch)
tree2592e47bd5b7b210af945a5b38d01d59aef3b200 /src/util.c
parentde223536b5d8a678c405c3a7aa2d0a67b34e4f3b (diff)
downloadlibsolv-12e4557bf5ebd32ca31e88ea54dfe0f217358ba7.tar.gz
libsolv-12e4557bf5ebd32ca31e88ea54dfe0f217358ba7.tar.bz2
libsolv-12e4557bf5ebd32ca31e88ea54dfe0f217358ba7.zip
Provide qsort_r in case (e.g. for RHEL 4)
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 294930f..e4b75c0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -98,6 +98,12 @@ sat_timems(unsigned int subtract)
return r - subtract;
}
+#ifdef HAVE_OWN_QSORT
+#define __FBSDID(x)
+#define I_AM_QSORT_R
+#include "qsort.c"
+#endif
+
/* bsd's qsort_r has different arguments, so we define our
own version in case we need to do some clever mapping
@@ -107,7 +113,7 @@ void
sat_sort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *compard)
{
#if defined(__GLIBC__)
-# if __GLIBC_PREREQ(2, 8)
+# if __GLIBC_PREREQ(2, 8) || defined(HAVE_OWN_QSORT)
qsort_r(base, nmemb, size, compar, compard);
# else
/* backported for SLE10-SP2 */