From: Emden R. Gansner Date: Wed, 6 Jan 2016 19:14:05 +0000 (-0500) Subject: Fix different calling conventions for qsort_s. X-Git-Tag: TRAVIS_CI_BUILD_EXPERIMENTAL~65^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0cc697488a207a981a1aeb145e8a23e7e5cb8b08;p=graphviz Fix different calling conventions for qsort_s. --- diff --git a/lib/common/postproc.c b/lib/common/postproc.c index 6130bc81b..f23a8e5e9 100644 --- a/lib/common/postproc.c +++ b/lib/common/postproc.c @@ -641,8 +641,10 @@ static void addXLabels(Agraph_t * gp) if (priorities) { xlabs.priorities = priorities; xlabs.p0 = objs; -#if defined(WIN32) || defined(DARWIN) +#if defined(WIN32) qsort_s(objs, n_objs, sizeof(object_t), (qsort_s_cmpf)cmp_obj, &xlabs); +#elif defined(DARWIN) + qsort_r(objs, n_objs, sizeof(object_t), &xlabs, (qsort_s_cmpf)cmp_obj); #elif (__GLIBC__ == 2 && __GLIBC_MINOR__ < 8) // EL5 has glibc 2.5 and no qsort_r XLABS=&xlabs; //uses global - non-rentrant