openwrt/tools/squashfs4/patches/006-Move-sysinfo.h-into-the-linux-only-section-should-fi.patch

50 lines
1.3 KiB
Diff
Raw Normal View History

From b2f6454a2b2517cfba7a24cf02e9bdf3b959c86a Mon Sep 17 00:00:00 2001
From: Tony Butler <spudz76@gmail.com>
Date: Sat, 18 Feb 2023 13:20:48 -0800
Subject: [PATCH] Move sysinfo.h into the linux-only section, should fix build
on MacOS.
All compilers set `__linux__`, but `linux` may not be defined, and usage
was mixed. Use `__linux__` everywhere instead.
Signed-off-by: Tony Butler <spudz76@gmail.com>
---
squashfs-tools/mksquashfs.c | 6 +++---
squashfs-tools/unsquashfs.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -50,9 +50,9 @@
#include <sys/wait.h>
#include <limits.h>
#include <ctype.h>
-#include <sys/sysinfo.h>
-#ifdef linux
+#ifdef __linux__
+#include <sys/sysinfo.h>
#include <sched.h>
#else
#include <sys/sysctl.h>
@@ -5081,7 +5081,7 @@ static void initialise_threads(int readq
BAD_ERROR("Failed to set signal mask in intialise_threads\n");
if(processors == -1) {
-#ifdef linux
+#ifdef __linux__
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
--- a/squashfs-tools/unsquashfs.c
+++ b/squashfs-tools/unsquashfs.c
@@ -2720,7 +2720,7 @@ void initialise_threads(int fragment_buf
}
if(processors == -1) {
-#ifdef linux
+#ifdef __linux__
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);