]> granicus.if.org Git - graphviz/commitdiff
no qsort_r() on EL5 - needs alternative implementation
authorJohn Ellson <ellson@research.att.com>
Tue, 5 Jan 2016 22:23:18 +0000 (17:23 -0500)
committerJohn Ellson <ellson@research.att.com>
Tue, 5 Jan 2016 22:23:18 +0000 (17:23 -0500)
lib/common/postproc.c

index ea301aed72062ade6f6d7275b650d659f31640c1..78b5a840b4b78143103dec9407aeb2c538aab6d1 100644 (file)
@@ -432,31 +432,6 @@ static int cmp_obj(object_t* obj0, object_t* obj1, xlabel_state* state)
 }
 #endif
 
-#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 8)
-void git__insertsort_r(
-       void *els, size_t nel, size_t elsize, void *swapel,
-       git__sort_r_cmp cmp, void *payload)
-{
-       uint8_t *base = els;
-       uint8_t *end = base + nel * elsize;
-       uint8_t *i, *j;
-       bool freeswap = !swapel;
-
-       if (freeswap)
-               swapel = git__malloc(elsize);
-
-       for (i = base + elsize; i < end; i += elsize)
-               for (j = i; j > base && cmp(j, j - elsize, payload) < 0; j -= elsize) {
-                       memcpy(swapel, j, elsize);
-                       memcpy(j, j - elsize, elsize);
-                       memcpy(j - elsize, swapel, elsize);
-               }
-
-       if (freeswap)
-               git__free(swapel);
-}
-#endif
-
 static void addXLabels(Agraph_t * gp)
 {
     Agnode_t *np;
@@ -656,7 +631,7 @@ static void addXLabels(Agraph_t * gp)
        qsort_s(objs, n_objs, sizeof(object_t), (qsortr_cmpf)cmp_obj, &xlabs);
 #elif (__GLIBC__ == 2 && __GLIBC_MINOR__ < 8)
        // EL5 has glibc 2.5 and no qsort_r
-       qsort_s(objs, n_objs, sizeof(object_t), (qsortr_cmpf)cmp_obj, &xlabs);
+       // FIXME - need alternative implementation here
 #else
        qsort_r(objs, n_objs, sizeof(object_t), (qsortr_cmpf)cmp_obj, &xlabs);
 #endif