aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2021-07-28 23:46:36 -0400
committerTheodore Ts'o <tytso@mit.edu>2021-07-28 23:46:36 -0400
commit9aba05286c492927b81844193f941386f71ba829 (patch)
tree1125ed8a674ba7fb1aca98443fd701e24115938d
parent225e5d093b519f9dbe9fcaacd995426f0e5194f6 (diff)
downloade2fsprogs-9aba05286c492927b81844193f941386f71ba829.tar.gz
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 <tytso@mit.edu>
-rw-r--r--lib/support/sort_r.h8
1 files changed, 4 insertions, 4 deletions
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