From: Theodore Ts'o Date: Thu, 29 Jul 2021 03:46:36 +0000 (-0400) Subject: libsupport: fix sort_r.h to work on the GNU Hurd X-Git-Tag: v1.46.4~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9aba05286c492927b81844193f941386f71ba829;p=thirdparty%2Fe2fsprogs.git 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 --- diff --git a/lib/support/sort_r.h b/lib/support/sort_r.h index dc17e8af7..156e99012 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