From: Damjan Marion Date: Thu, 29 May 2014 22:52:06 +0000 (+0200) Subject: osx: fix crash during the tvh_qsort_r() X-Git-Tag: v4.1~2020^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F407%2Fhead;p=thirdparty%2Ftvheadend.git osx: fix crash during the tvh_qsort_r() --- diff --git a/src/wrappers.c b/src/wrappers.c index db3b5a168..3edb86cc7 100644 --- a/src/wrappers.c +++ b/src/wrappers.c @@ -172,7 +172,7 @@ qsort_r(void *base, size_t nmemb, size_t size, #endif /* ENABLE_QSORT_R */ -#if defined(PLATFORM_FREEBSD) +#if defined(PLATFORM_FREEBSD) || defined(PLATFORM_DARWIN) struct tvh_qsort_data { void *arg; int (*compar)(const void *, const void *, void *); @@ -185,13 +185,13 @@ tvh_qsort_swap(void *arg, const void *a, const void *b) struct tvh_qsort_data *data = arg; return data->compar(a, b, data->arg); } -#endif /* PLATFORM_FREEBSD */ +#endif /* PLATFORM_FREEBSD || PLATFORM_DARWIN */ void tvh_qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *arg) { -#if defined(PLATFORM_FREEBSD) +#if defined(PLATFORM_FREEBSD) || defined(PLATFORM_DARWIN) struct tvh_qsort_data swap_arg = {arg, compar}; qsort_r(base, nmemb, size, &swap_arg, tvh_qsort_swap); #else