From 3b7ed0e67f919e49ea8b1f5387c14b762f446b45 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 3 Jul 2023 11:36:47 +0200 Subject: [PATCH] Fix sort_r selection on GNU/Hurd Origin: upstream, https://github.com/dajobe/raptor/commit/3b7ed0e67f919e49ea8b1f5387c14b762f446b45 Forwarded: not-needed The Hurd is based on the Mach microkernel, and thus __MACH__ is defined; since also macOS is (loosely) based on Mach, it defines __MACH__ as well. Because of this, the wrong variant of sort_r (i.e. the BSD one) is used for the Hurd, which does not work. Since on macOS __APPLE__ is defined, and __DARWIN__ helps for older Mac OS X, then simply drop the __MACH__ selection: the preprocessor check for the Linux sort_r is properly used for the Hurd (using __GNU__), and that variant works fine. --- src/sort_r.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sort_r.h b/src/sort_r.h index cfbde7f4..bdc4b2cc 100644 --- a/src/sort_r.h +++ b/src/sort_r.h @@ -19,7 +19,7 @@ void sort_r(void *base, size_t nel, size_t width, void *arg); */ -#if (defined __APPLE__ || defined __MACH__ || defined __DARWIN__ || \ +#if (defined __APPLE__ || defined __DARWIN__ || \ defined __FreeBSD__ || defined __BSD__ || defined __bsdi__ || \ defined OpenBSD3_1 || defined OpenBSD3_9 || defined __OpenBSD__ || \ defined __NetBSD__ || \ -- 2.40.1