aboutsummaryrefslogtreecommitdiffstats
path: root/tools/squashfs4/patches/006-Move-sysinfo.h-into-the-linux-only-section-should-fi.patch
blob: 364356188ffb08342fd7da055c101bc69fc8c074 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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);