]> granicus.if.org Git - graphviz/commitdiff
no qsort_r() on EL5
authorJohn Ellson <ellson@research.att.com>
Tue, 5 Jan 2016 21:21:59 +0000 (16:21 -0500)
committerJohn Ellson <ellson@research.att.com>
Tue, 5 Jan 2016 21:21:59 +0000 (16:21 -0500)
lib/common/postproc.c

index 5e30687a076af815d0b2f33442d2dbb3d3a43176..17b51aad6d5af024fae39663cb16aba7558c293e 100644 (file)
@@ -629,6 +629,9 @@ static void addXLabels(Agraph_t * gp)
        xlabs.p0 = objs;
 #if defined(WIN32)
        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
+       git__insertsort_r(objs, n_objs, sizeof(object_t), NULL, (qsortr_cmpf)cmp_obj, &xlabs);
 #else
        qsort_r(objs, n_objs, sizeof(object_t), (qsortr_cmpf)cmp_obj, &xlabs);
 #endif