<html><head></head><body>Hi,<br><br>Thanks for the review. As I cannot test it (or cannot be bothered to install a FreeBSD VM), I have no plans to update the patch myself though.<br><br><div class="gmail_quote">Le 29 novembre 2018 14:33:44 GMT+02:00, Marvin Scholz <epirat07@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 20 Nov 2018, at 17:16, Rémi Denis-Courmont wrote:<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> This is untested.<hr> configure.ac | 15 +++++++++++++++<br> include/vlc_fixups.h | 4 ++++<br> 2 files changed, 19 insertions(+)<br><br> diff --git a/configure.ac b/configure.ac<br> index 1f33f5dc88..21fcb45203 100644<br> --- a/configure.ac<br> +++ b/configure.ac<br> @@ -742,6 +742,21 @@ AC_CHECK_LIB([m], [sincos], [<br> AC_LIBOBJ([sincos])<br> ])<br><br> +AC_MSG_CHECKING([broken qsort_r prototype])<br> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h><br> +<br> +_Static_assert(_Generic((qsort_r),<br> + void (*)(void *, size_t, size_t, void *,<br> + int (*)(void *, const void *, const void *)) : 1, <br> default: 0),<br> + "Bad prototype not matched");<br> +])], [<br> + AC_MSG_RESULT([broken])<br> + AC_DEFINE([HAVE_BROKEN_QSORT_R], 1, [Defined to 1 if the qsort_r() <br> prototype contradicts the upcoming POSIX standard.])<br> + AC_LIBOBJ([qsort_r])<br> +], [<br> + AC_MSG_RESULT([no])<br> +])<br> +<br> AC_MSG_CHECKING([_Thread_local support])<br> AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;<br> int main() {}])], [<br> diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h<br> index 0263286efc..45fec0f6d4 100644<br> --- a/include/vlc_fixups.h<br> +++ b/include/vlc_fixups.h<br> @@ -224,6 +224,10 @@ long long atoll (const char *);<br> lldiv_t lldiv (long long, long long);<br> #endif<br><br> +#ifdef HAVE_BROKEN_QSORT_R<br> +# define qsort_r posix_qsort_r<br> +#endif<br> +<br> #ifndef HAVE_QSORT_R<br> void (qsort_r)(void *, size_t, size_t,<br> int (*)(const void *, const void *, void *), void *);<br> -- <br> 2.19.1<br></blockquote><br>Thanks for the patch, this actually affects Darwin too and probably<br>every other BSD variant.<br><br>With the patch applied configure properly detects the qsort_r as having <br>the<br>wrong prototype but the compat replacement collides with the already <br>existing<br>qsort_r declaration:<br><br> CC qsort_r.lo<br>../../extras/package/macosx/../../../compat/qsort_r.c:41:6: error: <br>conflicting types for 'posix_qsort_r'<br>void qsort_r(void *base, size_t nmemb, size_t size,<br> ^<br>../../extras/package/macosx/../../../include/vlc_fixups.h:228:18: note: <br>expanded from macro 'qsort_r'<br># define qsort_r posix_qsort_r<br> ^<br>/[...]/usr/include/stdlib.h:330:7: note: previous declaration is here<br>void qsort_r(void *__base, size_t __nel, size_t __width, void *,<br> ^<br>../../extras/package/macosx/../../../include/vlc_fixups.h:228:18: note: <br>expanded from macro 'qsort_r'<br># define qsort_r posix_qsort_r<br> ^<br>1 error generated.<br>make[3]: *** [qsort_r.lo] Error 1<br><br>><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>