[vlc-commits] configure: detect broken qsort_r

Thomas Guillem git at videolan.org
Tue Jan 22 18:56:12 CET 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jan 22 14:18:07 2019 +0100| [2bc72d3faee055551a5882c08bd56faaf72c8758] | committer: Thomas Guillem

configure: detect broken qsort_r

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2bc72d3faee055551a5882c08bd56faaf72c8758
---

 configure.ac | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/configure.ac b/configure.ac
index 1b63a74736..96e0862ffb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -747,6 +747,20 @@ AC_CHECK_LIB([m], [sincos], [
   AC_LIBOBJ([sincos])
 ])
 
+AC_MSG_CHECKING([broken qsort_r prototype])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
+
+_Static_assert(_Generic((qsort_r),
+    void (*)(void *, size_t, size_t, void *,
+             int (*)(void *, const void *, const void *)) : 1, default: 0),
+    "Bad prototype not matched");
+])], [
+  AC_MSG_RESULT([broken])
+  AC_DEFINE([HAVE_BROKEN_QSORT_R], 1, [Defined to 1 if the qsort_r() prototype contradicts the upcoming POSIX standard.])
+], [
+  AC_MSG_RESULT([no])
+])
+
 AC_MSG_CHECKING([_Thread_local support])
 AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int foo = 0;
                    int main() {}])], [



More information about the vlc-commits mailing list