summaryrefslogtreecommitdiff
path: root/graphics/lepton/files/patch-bsd
blob: cac857193116ff1086e7e1b7c38d89aafda48286 (plain) (blame)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
Make buildable on BSD-systems other than Apple. Mostly this
simply replaces #ifdef __APPLE__ with #ifdef BSD, but not
only...

	-mi

+++ src/io/DecoderPlatform.hh
@@ -26,7 +26,7 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#if defined (__linux) || defined (__APPLE__)
+#if defined (__linux) || defined (BSD)
 #define SIRIKATA_FUNCTION_EXPORT __attribute__ ((visibility("default")))
 #define SIRIKATA_EXPORT __attribute__ ((visibility("default")))
 #define SIRIKATA_PLUGIN_EXPORT __attribute__ ((visibility("default")))
+++ src/io/MemMgrAllocator.cc
@@ -41,7 +41,7 @@
 #include <cstdint>
 #include "DecoderPlatform.hh"
 #include "MemMgrAllocator.hh"
-#if (defined(__APPLE__) || __cplusplus <= 199711L) && !defined(_WIN32)
+#if (defined(BSD) || __cplusplus <= 199711L) && !defined(_WIN32)
 #define THREAD_LOCAL_STORAGE __thread
 #else
 #include <atomic>
@@ -151,7 +151,7 @@ void setup_memmgr(MemMgrState& memmgr, u
 }
 void memmgr_init(size_t main_thread_pool_size, size_t worker_thread_pool_size, size_t num_workers, size_t x_min_pool_alloc_quantas, bool needs_huge_pages)
 {
-#ifdef __APPLE__
+#ifdef BSD
     // in apple, the thread_local storage winds up different when destroying the thread
     num_workers *= 2;
 #endif
+++ src/lepton/fork_serve.cc
@@ -10,7 +10,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <algorithm>
-#ifndef __APPLE__
+#ifndef BSD
 #include <wait.h>
 #else
 #include <sys/wait.h>
+++ src/lepton/socket_serve.cc
@@ -11,7 +11,7 @@
 #include <algorithm>
 #include <netinet/in.h>
 #include <sys/time.h>
-#ifndef __APPLE__
+#ifndef BSD
 #include <sys/signalfd.h>
 #include <wait.h>
 #else
@@ -127,7 +127,7 @@ int should_wait_bitmask(size_t children_
 
 int make_sigchld_fd() {
     int fd = -1;
-#ifndef __APPLE__
+#ifndef BSD
     sigset_t sigset;
     int err = sigemptyset(&sigset);
     always_assert(err == 0);
@@ -233,7 +233,7 @@ void serving_loop(int unix_domain_socket
             if (fds[i].revents & POLLIN) {
                 fds[i].revents = 0;
                 if (fds[i].fd == sigchild_fd) {
-#ifndef __APPLE__
+#ifndef BSD
                     struct signalfd_siginfo info;
                     ssize_t ignore = read(fds[i].fd, &info, sizeof(info));
                     (void)ignore;
+++ src/vp8/model/jpeg_meta.hh
@@ -3,7 +3,7 @@
 
 #include <vector>
 #include <type_traits>
-#ifndef __APPLE__
+#ifndef BSD
 #ifndef _WIN32
 #include <endian.h>
 #endif
+++ src/vp8/util/memory.cc
@@ -13,7 +13,7 @@
 #ifdef _WIN32
 #define USE_STANDARD_MEMORY_ALLOCATORS
 #endif
-#if defined(__APPLE__) || (__cplusplus <= 199711L && !defined(_WIN32))
+#if defined(BSD) || (__cplusplus <= 199711L && !defined(_WIN32))
 #define THREAD_LOCAL_STORAGE __thread
 #else
 #define THREAD_LOCAL_STORAGE thread_local
+++ src/vp8/util/vpx_config.hh
@@ -44,6 +44,6 @@
 #ifndef _BSD_SOURCE
 #define _BSD_SOURCE       /* See feature_test_macros(7) */
 #endif
-#include <endian.h>
+#include <sys/endian.h>
 #endif
 #endif
+++ test_suite/timing_driver.cc
@@ -6,11 +6,13 @@
 #include <unistd.h>
 #include <assert.h>
 #include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <fcntl.h>
 #include <sys/select.h>
+#include <sys/signal.h>
 #include <sys/time.h>
 #include "smalljpg.hh"
 
+++ src/lepton/jpgcoder.cc
@@ -77,11 +77,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 int g_argc = 0;
 const char** g_argv = NULL;
 #ifndef GIT_REVISION
-#include "version.hh"
-#ifndef GIT_REVISION
 #define GIT_REVISION "unknown"
 #endif
-#endif
 bool fast_exit = true;
 #ifdef SKIP_VALIDATION
 bool g_skip_validation = true;
+++ src/io/ioutil.cc
@@ -325,13 +325,13 @@
     int input_tee_flags = 0;
     int copy_to_storage_flags = 0;
-#ifndef __APPLE__
+#ifndef BSD
     input_tee_flags = fcntl(input_tee, F_GETFL, 0);
 #endif
     fcntl(input_tee, F_SETFL, input_tee_flags | O_NONBLOCK);
-#ifndef __APPLE__
+#ifndef BSD
     copy_to_input_tee_flags = fcntl(copy_to_input_tee, F_GETFL, 0);
 #endif
     fcntl(copy_to_input_tee, F_SETFL, copy_to_input_tee_flags | O_NONBLOCK);
-#ifndef __APPLE__
+#ifndef BSD
     copy_to_storage_flags = fcntl(copy_to_storage, F_GETFL, 0);
 #endif