364356188ffb08342fd7da055c101bc69fc8c074
[openwrt/staging/dedeckeh.git] / tools / squashfs4 / patches / 006-Move-sysinfo.h-into-the-linux-only-section-should-fi.patch
1 From b2f6454a2b2517cfba7a24cf02e9bdf3b959c86a Mon Sep 17 00:00:00 2001
2 From: Tony Butler <spudz76@gmail.com>
3 Date: Sat, 18 Feb 2023 13:20:48 -0800
4 Subject: [PATCH] Move sysinfo.h into the linux-only section, should fix build
5 on MacOS.
6
7 All compilers set `__linux__`, but `linux` may not be defined, and usage
8 was mixed. Use `__linux__` everywhere instead.
9
10 Signed-off-by: Tony Butler <spudz76@gmail.com>
11 ---
12 squashfs-tools/mksquashfs.c | 6 +++---
13 squashfs-tools/unsquashfs.c | 2 +-
14 2 files changed, 4 insertions(+), 4 deletions(-)
15
16 --- a/squashfs-tools/mksquashfs.c
17 +++ b/squashfs-tools/mksquashfs.c
18 @@ -50,9 +50,9 @@
19 #include <sys/wait.h>
20 #include <limits.h>
21 #include <ctype.h>
22 -#include <sys/sysinfo.h>
23
24 -#ifdef linux
25 +#ifdef __linux__
26 +#include <sys/sysinfo.h>
27 #include <sched.h>
28 #else
29 #include <sys/sysctl.h>
30 @@ -5081,7 +5081,7 @@ static void initialise_threads(int readq
31 BAD_ERROR("Failed to set signal mask in intialise_threads\n");
32
33 if(processors == -1) {
34 -#ifdef linux
35 +#ifdef __linux__
36 cpu_set_t cpu_set;
37 CPU_ZERO(&cpu_set);
38
39 --- a/squashfs-tools/unsquashfs.c
40 +++ b/squashfs-tools/unsquashfs.c
41 @@ -2720,7 +2720,7 @@ void initialise_threads(int fragment_buf
42 }
43
44 if(processors == -1) {
45 -#ifdef linux
46 +#ifdef __linux__
47 cpu_set_t cpu_set;
48 CPU_ZERO(&cpu_set);
49