From 9aba05286c492927b81844193f941386f71ba829 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 28 Jul 2021 23:46:36 -0400 Subject: [PATCH] libsupport: fix sort_r.h to work on the GNU Hurd On the GNU Hurd both __MACH__ and __GNU__ are defined. So rearrange the #ifdef to prioritize checking for GLIBC compatibility over BSD compatibility. Signed-off-by: Theodore Ts'o --- lib/support/sort_r.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/support/sort_r.h b/lib/support/sort_r.h index dc17e8a..156e990 100644 --- a/lib/support/sort_r.h +++ b/lib/support/sort_r.h @@ -24,12 +24,12 @@ void sort_r(void *base, size_t nel, size_t width, #define _SORT_R_INLINE inline -#if (defined __APPLE__ || defined __MACH__ || defined __DARWIN__ || \ - defined __FreeBSD__ || defined __DragonFly__) -# define _SORT_R_BSD -#elif (defined _GNU_SOURCE || defined __gnu_hurd__ || defined __GNU__ || \ +#if (defined _GNU_SOURCE || defined __gnu_hurd__ || defined __GNU__ || \ defined __linux__ || defined __MINGW32__ || defined __GLIBC__) # define _SORT_R_LINUX +#elif (defined __APPLE__ || defined __MACH__ || defined __DARWIN__ || \ + defined __FreeBSD__ || defined __DragonFly__) +# define _SORT_R_BSD #elif (defined _WIN32 || defined _WIN64 || defined __WINDOWS__) # define _SORT_R_WINDOWS # undef _SORT_R_INLINE -- 1.8.3.1