summaryrefslogtreecommitdiff
path: root/tools/squashfs/patches/darwin.patch
blob: b1d2ebd2e4582505aa8f13143a56d6aef6fdd7b8 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
diff -Nur squashfs4.2.orig/squashfs-tools/mksquashfs.c squashfs4.2/squashfs-tools/mksquashfs.c
--- squashfs4.2.orig/squashfs-tools/mksquashfs.c	2011-02-28 23:24:09.000000000 +0100
+++ squashfs4.2/squashfs-tools/mksquashfs.c	2014-03-22 11:32:00.000000000 +0100
@@ -60,6 +60,10 @@
 #include <sys/sysinfo.h>
 #endif
 
+#ifndef FNM_EXTMATCH 
+#define FNM_EXTMATCH 0 
+#endif 
+
 #ifdef SQUASHFS_TRACE
 #define TRACE(s, args...) \
 		do { \
@@ -721,13 +725,13 @@
 			+ (((char *)A) - data_cache)))
 
 
-inline void inc_progress_bar()
+static inline void inc_progress_bar()
 {
 	cur_uncompressed ++;
 }
 
 
-inline void update_progress_bar()
+static inline void update_progress_bar()
 {
 	pthread_mutex_lock(&progress_mutex);
 	pthread_cond_signal(&progress_wait);
@@ -735,7 +739,7 @@
 }
 
 
-inline void waitforthread(int i)
+static inline void waitforthread(int i)
 {
 	TRACE("Waiting for thread %d\n", i);
 	while(thread[i] != 0)
@@ -3340,7 +3344,7 @@
 }
 
 
-inline void add_dir_entry(char *name, char *pathname, struct dir_info *sub_dir,
+static inline void add_dir_entry(char *name, char *pathname, struct dir_info *sub_dir,
 	struct inode_info *inode_info, struct dir_info *dir)
 {
 	if((dir->count % DIR_ENTRIES) == 0) {
diff -Nur squashfs4.2.orig/squashfs-tools/unsquashfs.c squashfs4.2/squashfs-tools/unsquashfs.c
--- squashfs4.2.orig/squashfs-tools/unsquashfs.c	2011-02-28 23:27:06.000000000 +0100
+++ squashfs4.2/squashfs-tools/unsquashfs.c	2014-03-22 11:36:27.000000000 +0100
@@ -29,7 +29,13 @@
 #include "compressor.h"
 #include "xattr.h"
 
+#ifndef FNM_EXTMATCH 
+#define FNM_EXTMATCH 0 
+#endif 
+
+#ifdef __linux__
 #include <sys/sysinfo.h>
+#endif
 #include <sys/types.h>
 
 struct cache *fragment_cache, *data_cache;
@@ -1810,7 +1816,7 @@
 			"\n");
 
 	if(processors == -1) {
-#ifndef linux
+#if 0
 		int mib[2];
 		size_t len = sizeof(processors);
 
@@ -1821,11 +1827,13 @@
 		mib[1] = HW_NCPU;
 #endif
 
+#ifdef __linux__
 		if(sysctl(mib, 2, &processors, &len, NULL, 0) == -1) {
 			ERROR("Failed to get number of available processors.  "
 				"Defaulting to 1\n");
 			processors = 1;
 		}
+#endif
 #else
 		processors = sysconf(_SC_NPROCESSORS_ONLN);
 #endif