Try to fix FTBFS on kfreebsd architecture

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4081

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15058>
This commit is contained in:
Laurent Bigonville 2022-02-17 14:49:27 +01:00
parent 14810f3498
commit 0edf63de76
3 changed files with 6 additions and 5 deletions

View File

@ -19,6 +19,7 @@
#else /* One of the BSDs */
#include <stdint.h>
#include <sys/types.h>
#include <sys/ioccom.h>

View File

@ -57,7 +57,10 @@ util_qsort_r(void *base, size_t nmemb, size_t size,
void *arg)
{
#if HAVE_QSORT_R
# if DETECT_OS_APPLE || DETECT_OS_BSD
# if defined(__GLIBC__)
/* GNU extension added in glibc 2.8 */
qsort_r(base, nmemb, size, compar, arg);
# elif (DETECT_OS_APPLE || DETECT_OS_BSD)
/* BSD/macOS qsort_r takes "arg" before the comparison function and it
* pass the "arg" before the elements.
*/
@ -66,9 +69,6 @@ util_qsort_r(void *base, size_t nmemb, size_t size,
arg
};
qsort_r(base, nmemb, size, &data, util_qsort_adapter);
# else
/* GNU extension added in glibc 2.8 */
qsort_r(base, nmemb, size, compar, arg);
# endif
#elif HAVE_QSORT_S
# ifdef _WIN32

View File

@ -131,7 +131,7 @@ static inline int u_thread_create(thrd_t *thrd, int (*routine)(void *), void *pa
static inline void u_thread_setname( const char *name )
{
#if defined(HAVE_PTHREAD)
#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS
#if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS || defined(__GLIBC__)
int ret = pthread_setname_np(pthread_self(), name);
if (ret == ERANGE) {
char buf[16];