diff --git a/include/drm-uapi/sync_file.h b/include/drm-uapi/sync_file.h index 11d86db53e4..7ede34e12de 100644 --- a/include/drm-uapi/sync_file.h +++ b/include/drm-uapi/sync_file.h @@ -19,6 +19,7 @@ #else /* One of the BSDs */ +#include #include #include diff --git a/src/util/u_qsort.h b/src/util/u_qsort.h index 34fff94dba4..6ab9d4927ee 100644 --- a/src/util/u_qsort.h +++ b/src/util/u_qsort.h @@ -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 diff --git a/src/util/u_thread.h b/src/util/u_thread.h index f2187e551dd..ec30eb4f478 100644 --- a/src/util/u_thread.h +++ b/src/util/u_thread.h @@ -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];