From 71d136ecceb2f125a2de02357272945f50b50dfd Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Fri, 30 May 2014 00:52:06 +0200 Subject: [PATCH] osx: fix crash during the tvh_qsort_r() --- src/wrappers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wrappers.c b/src/wrappers.c index db3b5a16..3edb86cc 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