]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
osx: fix crash during the tvh_qsort_r() 407/head
authorDamjan Marion <damjan.marion@gmail.com>
Thu, 29 May 2014 22:52:06 +0000 (00:52 +0200)
committerDamjan Marion <damjan.marion@gmail.com>
Thu, 29 May 2014 22:52:06 +0000 (00:52 +0200)
src/wrappers.c

index db3b5a16852735ff1ddefa03583bf13eb5871835..3edb86cc7c6e4755bb4304b78ccbf24669276da6 100644 (file)
@@ -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