Whamcloud - gitweb
libsupport: fix sort_r.h to work on the GNU Hurd
authorTheodore Ts'o <tytso@mit.edu>
Thu, 29 Jul 2021 03:46:36 +0000 (23:46 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 29 Jul 2021 03:46:36 +0000 (23:46 -0400)
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 <tytso@mit.edu>
lib/support/sort_r.h

index dc17e8a..156e990 100644 (file)
@@ -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