version update, rpm spec libva/vdpau fix, colorpicker tweaks, revert opencv v4->v3
[goodguy/cinelerra.git] / cinelerra-5.1 / blds / bsd.patch
1 diff --git a/cinelerra-5.1/Makefile.devel b/cinelerra-5.1/Makefile.devel
2 index a12d8f2b..9aac014a 100644
3 --- a/cinelerra-5.1/Makefile.devel
4 +++ b/cinelerra-5.1/Makefile.devel
5 @@ -4,7 +4,7 @@ TOPDIR := $(CURDIR)
6  CFLAGS ?= -ggdb
7  export CFLAGS_ := $(CFLAGS)
8  
9 -cpus:=$(shell grep -c "^proc" /proc/cpuinfo)
10 +cpus:=$(shell sysctl -n hw.ncpu)
11  jobs:=-j$(shell echo $$(($(cpus) + $(cpus)/2 +2)))
12  MAKEJ := $(MAKE) $(jobs)
13  
14 diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
15 index 18590e3a..5eead290 100644
16 --- a/cinelerra-5.1/cinelerra/Makefile
17 +++ b/cinelerra-5.1/cinelerra/Makefile
18 @@ -395,6 +395,7 @@ LIBS += -lfontconfig -lfreetype
19  LIBS += -lavcodec -lavdevice -lavfilter -lavformat -lavresample -lavutil
20  LIBS += -lswresample -lswscale
21  LIBS += -lvpx -lwebp -lwebpmux
22 +LIBS += -lintl -liconv -lexecinfo
23  
24  LIBS += $(if $(filter fftw,$(static_pkgs)), -lfftw3)
25  LIBS += $(if $(filter flac,$(static_pkgs)), -lFLAC)
26 @@ -414,7 +415,7 @@ LIBS += $(if $(filter x265,$(static_pkgs)), -lx265)
27  LIBS += $(if $(filter libvpx,$(static_pkgs)), -lvpx)
28  
29  ifneq ($(WANT_GL),no)
30 -LIBS += -lGL -lGLU -lGLX
31 +LIBS += -lGL -lGLU
32  endif
33  ifneq ($(WANT_XFT),no)
34  LIBS += -lXft
35 @@ -476,6 +477,7 @@ LV2OBJS = \
36  endif
37  
38  CFLAGS := \
39 +       -I/usr/local/include \
40         -I$(GUICAST) \
41         -I$(LIBZMPEG3) \
42         $(static_incs) \
43 @@ -523,15 +525,15 @@ all:      $(OUTPUT) $(CUTADS) $(BDWRITE) $(LV2UI)
44  $(OUTPUT): $(OBJS) $(THEME_DATA) $(DCRAW) $(LIBRARIES)
45         $(LINKER) `cat $(OBJDIR)/objs`
46         $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G))
47 -       $(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
48 +       #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
49         ln -f -s ../bin/$(WANT_CIN) ci
50  
51  ifneq ($(WANT_COMMERCIAL),no)
52  $(CUTADS):     $(CUTOBJS) $(CUTLIBS) $(LIBRARIES)
53 -       @echo g++ -o $@ $(CUTOBJS)
54 -       @g++ $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS) $(LIBS)
55 +       @echo $(CXX) -o $@ $(CUTOBJS)
56 +       @$(CXX) $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS) $(LIBS)
57         $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(CUTADS) $(CUTADS).debuginfo)
58 -       $(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS))
59 +       #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS))
60  
61  install-cutads:
62         cp -av $(OBJDIR)/cutads $(BINDIR)/.
63 @@ -540,18 +542,18 @@ install:  install-cutads
64  endif
65  
66  $(BDWRITE):    $(BDWOBJS) $(LIBRARIES)
67 -       @echo g++ -o $@ $(BDWOBJS)
68 -       @g++ $(CFLAGS) -pthread -o $@ $(BDWOBJS) $(LIBS)
69 +       @echo $(CXX) -o $@ $(BDWOBJS)
70 +       @$(CXX) $(CFLAGS) -pthread -o $@ $(BDWOBJS) $(LIBS)
71         $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(BDWRITE) $(BDWRITE).debuginfo)
72 -       $(if $(findstring -ggdb,$(CFLAGS)),,strip $(BDWRITE))
73 +       #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(BDWRITE))
74  
75  install-bdwrite:
76         cp -av $(OBJDIR)/bdwrite $(BINDIR)/.
77  install:       install-bdwrite
78  
79  ydiff: ydiff.C $(LIBRARIES)
80 -       @echo g++ -o $@ ydiff.C
81 -       @g++ $(CFLAGS) ydiff.C -o $@ $(LIBS)
82 +       @echo $(CXX) -o $@ ydiff.C
83 +       @$(CXX) $(CFLAGS) ydiff.C -o $@ $(LIBS)
84  
85  clean:
86         rm -rf $(OBJDIR)
87 @@ -585,7 +587,7 @@ $(OBJDIR)/lv2ui: $(LV2OBJS)
88         @echo $(CXX) \`cat $(OBJDIR)/c_flags\` $^ -o $@
89         @$(CXX) `cat $(OBJDIR)/c_flags` $^ -o $@ $(LIBS) $(GTK2_LIBS)
90         $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(LV2UI) $(LV2UI).debuginfo)
91 -       $(if $(findstring -ggdb,$(CFLAGS)),,strip $(LV2UI))
92 +       #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(LV2UI))
93  
94  .PHONY:        lv2ui
95  lv2ui: $(LV2UI)
96 diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C
97 index 27f728ad..9215090d 100644
98 --- a/cinelerra-5.1/cinelerra/bdcreate.C
99 +++ b/cinelerra-5.1/cinelerra/bdcreate.C
100 @@ -25,8 +25,8 @@
101  #include <unistd.h>
102  #include <fcntl.h>
103  #include <errno.h>
104 -#include <sys/stat.h>
105 -#include <sys/statfs.h>
106 +#include <sys/param.h>
107 +#include <sys/mount.h>
108  
109  // BD Creation
110  
111 diff --git a/cinelerra-5.1/cinelerra/bdwrite.C b/cinelerra-5.1/cinelerra/bdwrite.C
112 index 6a2b4ca3..78cf9bef 100644
113 --- a/cinelerra-5.1/cinelerra/bdwrite.C
114 +++ b/cinelerra-5.1/cinelerra/bdwrite.C
115 @@ -38,7 +38,7 @@
116  #include <stdint.h>
117  #include <stdlib.h>
118  #include <string.h>
119 -#include <endian.h>
120 +#include <sys/endian.h>
121  #include <limits.h>
122  #include <sys/stat.h>
123  // work arounds (centos)
124 diff --git a/cinelerra-5.1/cinelerra/cutads.C b/cinelerra-5.1/cinelerra/cutads.C
125 index ac58d56a..f6690cf2 100644
126 --- a/cinelerra-5.1/cinelerra/cutads.C
127 +++ b/cinelerra-5.1/cinelerra/cutads.C
128 @@ -23,14 +23,6 @@
129  using namespace std;
130  #define fail(s) do { printf("fail %s%s:%d\n",__func__,#s,__LINE__); return 1; } while(0)
131  
132 -/* missing from system headers, no /usr/include <linux/ioprio.h>
133 - *   IOPRIO_WHO_PROCESS, IOPRIO_CLASS_SHIFT, IOPRIO_CLASS_IDLE */
134 -enum { IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE, };
135 -#define IO_CLASS(n) (((int)(n)) << 13)
136 -#define IO_WHO_PROCESS  1
137 -#include <sys/syscall.h>
138 -#include <asm/unistd.h>
139 -
140  // commercial edge detection:
141  // must have audio < min_audio
142  //   and within +- check_margin seconds of low audio
143 @@ -55,11 +47,6 @@ class Video;
144  class Audio;
145  class Scan;
146  
147 -static int ioprio_set(int which, int who, int ioprio)
148 -{
149 -       return syscall(SYS_ioprio_set, which, who, ioprio);
150 -}
151 -
152  static inline int clip(int v, int mn, int mx)
153  {
154    return v<mn ? mn : v>mx ? mx : v;
155 @@ -617,7 +604,6 @@ class Scan
156         const char *asset_path;
157         static void set_priority(int pr, int io) {
158                 setpriority(PRIO_PROCESS, 0, pr);  // lowest cpu priority
159 -               ioprio_set(IO_WHO_PROCESS, 0, IO_CLASS(io));
160         }
161         class low_priority { public:
162                 low_priority() { set_priority(19, IOPRIO_CLASS_IDLE); }
163 diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C
164 index 1014baf5..f38094e9 100644
165 --- a/cinelerra-5.1/cinelerra/dvdcreate.C
166 +++ b/cinelerra-5.1/cinelerra/dvdcreate.C
167 @@ -24,8 +24,8 @@
168  #include <unistd.h>
169  #include <fcntl.h>
170  #include <errno.h>
171 -#include <sys/stat.h>
172 -#include <sys/statfs.h>
173 +#include <sys/param.h>
174 +#include <sys/mount.h>
175  
176  
177  #define DVD_PAL_4x3    0
178 diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C
179 index 13e1b457..9cc2f116 100644
180 --- a/cinelerra-5.1/cinelerra/file.C
181 +++ b/cinelerra-5.1/cinelerra/file.C
182 @@ -1594,7 +1594,10 @@ int File::record_fd()
183  void File::get_exe_path(char *result, char *bnp)
184  {
185  // Get executable path, basename
186 -       int len = readlink("/proc/self/exe", result, BCTEXTLEN-1);
187 +       char exe_path[BCTEXTLEN];
188 +       sprintf(exe_path,"/proc/%d/file",getpid());
189 +       int len = readlink(exe_path, result, BCTEXTLEN-1);
190 +
191         if( len >= 0 ) {
192                 result[len] = 0;
193                 char *ptr = strrchr(result, '/');
194 diff --git a/cinelerra-5.1/cinelerra/indexfile.C b/cinelerra-5.1/cinelerra/indexfile.C
195 index 3d21d2af..f3064199 100644
196 --- a/cinelerra-5.1/cinelerra/indexfile.C
197 +++ b/cinelerra-5.1/cinelerra/indexfile.C
198 @@ -70,7 +70,7 @@
199  
200  #include <sys/types.h>
201  #include <sys/stat.h>
202 -#include <linux/iso_fs.h>
203 +#include <isofs/cd9660/iso.h>
204  
205  // check for isofs volume_id for dvd/cdrom
206  
207 diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
208 index 1157b0a3..8c5ba61a 100644
209 --- a/cinelerra-5.1/configure.ac
210 +++ b/cinelerra-5.1/configure.ac
211 @@ -16,8 +16,18 @@ CFG_CFLAGS+=" -Wno-unused-result"
212  CFG_CFLAGS+=" -Wno-stringop-overflow"
213  CFG_CFLAGS+=" -Wno-format-truncation"
214  CFG_CFLAGS+=" -Wno-format-overflow"
215 +CFG_CFLAGS+=" -Wno-unknown-warning-option"
216  CFG_CFLAGS+=" -Wno-parentheses"
217  CFG_CFLAGS+=" -Wno-stringop-truncation"
218 +CFG_CFLAGS+=" -Wno-gnu-designator"
219 +CFG_CFLAGS+=" -Wno-missing-braces"
220 +CFG_CFLAGS+=" -Wno-overloaded-virtual"
221 +CFG_CFLAGS+=" -Wno-self-assign-field"
222 +CFG_CFLAGS+=" -Wno-sometimes-uninitialized"
223 +CFG_CFLAGS+=" -Wno-tautological-pointer-compare"
224 +CFG_CFLAGS+=" -Wno-unused-function"
225 +CFG_CFLAGS+=" -Wno-unused-private-field"
226 +CFG_CFLAGS+=" -Wno-infinite-recursion"
227  CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
228  CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
229  CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
230 @@ -127,7 +137,7 @@ AC_SUBST(MAK_INSTALLS)
231  AC_SUBST(MAK_UNINSTALLS)
232  
233  if test "x$WANT_JOBS" = "xauto"; then
234 -  CPUS=`grep -c "^proc" /proc/cpuinfo`
235 +  CPUS=`sysctl -n hw.ncpu`
236    WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
237  fi
238  
239 diff --git a/cinelerra-5.1/db/tdb.h b/cinelerra-5.1/db/tdb.h
240 index 8ee88002..9a17091e 100644
241 --- a/cinelerra-5.1/db/tdb.h
242 +++ b/cinelerra-5.1/db/tdb.h
243 @@ -32,7 +32,7 @@ inline void operator delete[](void *t,size_t n) { free(t); }
244  #endif
245  
246  #define ZMEDIA
247 -#define ZFUTEX
248 +//#define ZFUTEX
249  #ifdef ZFUTEX
250  #include <unistd.h>
251  #include <endian.h>
252 diff --git a/cinelerra-5.1/guicast/bclistbox.h b/cinelerra-5.1/guicast/bclistbox.h
253 index f5994d53..c73169bb 100644
254 --- a/cinelerra-5.1/guicast/bclistbox.h
255 +++ b/cinelerra-5.1/guicast/bclistbox.h
256 @@ -185,7 +185,9 @@ public:
257  
258  // take_focus - used by the suggestion box to keep it from taking focus from the
259  // textbox
260 -       int activate(int take_focus = 1);
261 +       int activate() {  return activate(1); }
262 +       int activate(int take_focus);
263 +
264         int activate(int x, int y, int w=-1, int h=-1);
265         int deactivate();
266         int is_active();
267 diff --git a/cinelerra-5.1/guicast/bcpan.h b/cinelerra-5.1/guicast/bcpan.h
268 index 40f5971f..73d47586 100644
269 --- a/cinelerra-5.1/guicast/bcpan.h
270 +++ b/cinelerra-5.1/guicast/bcpan.h
271 @@ -93,7 +93,8 @@ public:
272                 int &stick_x,
273                 int &stick_y);
274         static int rdtoxy(int &x, int &y, int a, int virtual_r);
275 -       int activate(int popup_x = -1, int popup_y = -1);
276 +       int activate(int popup_x, int popup_y);
277 +       int activate() { return activate(-1,-1); }
278         int deactivate();
279         float* get_values();
280  
281 diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C
282 index 1e927303..165883de 100644
283 --- a/cinelerra-5.1/guicast/bcresources.C
284 +++ b/cinelerra-5.1/guicast/bcresources.C
285 @@ -38,6 +38,7 @@
286  #include <iconv.h>
287  #include <sys/ipc.h>
288  #include <sys/shm.h>
289 +#include <sys/sysctl.h>
290  #include <X11/extensions/XShm.h>
291  #include <fontconfig/fontconfig.h>
292  #include <fontconfig/fcfreetype.h>
293 @@ -297,23 +298,12 @@ int BC_Resources::machine_cpus = 1;
294  
295  int BC_Resources::get_machine_cpus()
296  {
297 -       int cpus = 1;
298 -       FILE *proc = fopen("/proc/cpuinfo", "r");
299 -       if( proc ) {
300 -               char string[BCTEXTLEN], *cp;
301 -               while(!feof(proc) && fgets(string, sizeof(string), proc) ) {
302 -                       if( !strncasecmp(string, "processor", 9) &&
303 -                           (cp = strchr(string, ':')) != 0 ) {
304 -                               int n = atol(cp+1) + 1;
305 -                               if( n > cpus ) cpus = n;
306 -                       }
307 -                       else if( !strncasecmp(string, "cpus detected", 13) &&
308 -                           (cp = strchr(string, ':')) != 0 )
309 -                               cpus = atol(cp+1);
310 -               }
311 -               fclose(proc);
312 -       }
313 -       return cpus;
314 +       int mib[2], ncpu;
315 +       size_t len = sizeof(ncpu);
316 +       mib[0] = CTL_HW;
317 +       mib[1] = HW_NCPU;
318 +       if( sysctl(mib, 2, &ncpu, &len, 0, 0) ) ncpu = 1;
319 +       return ncpu;
320  }
321  
322  void BC_Resources::new_vframes(int n, VFrame *vframes[], ...)
323 @@ -695,7 +685,7 @@ new_vframes(20,default_medium_7segment,
324         generic_button_margin = 15;
325         draw_clock_background=1;
326  
327 -       use_shm = -1;
328 +       use_shm = 0;
329         shm_reply = 1;
330  
331  // Initialize
332 diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C
333 index ed50cfb1..f1b894ba 100644
334 --- a/cinelerra-5.1/guicast/bcsignals.C
335 +++ b/cinelerra-5.1/guicast/bcsignals.C
336 @@ -37,9 +37,11 @@
337  #include <sys/stat.h>
338  #include <unistd.h>
339  #include <sys/ioctl.h>
340 -#include <sys/prctl.h>
341  #include <sys/types.h>
342  
343 +#define dirent64 dirent
344 +#define readdir64 readdir
345 +
346  BC_Signals* BC_Signals::global_signals = 0;
347  static int signal_done = 0;
348  
349 @@ -279,18 +281,6 @@ static void handle_exit(int signum)
350  
351  void BC_Signals::set_sighup_exit(int enable)
352  {
353 -       if( enable ) {
354 -// causes SIGHUP to be generated when parent dies
355 -               signal(SIGHUP, handle_exit);
356 -               prctl(PR_SET_PDEATHSIG, SIGHUP, 0,0,0);
357 -// prevents ^C from signalling child when attached to gdb
358 -               setpgid(0, 0);
359 -               if( isatty(0) ) ioctl(0, TIOCNOTTY, 0);
360 -       }
361 -       else {
362 -               signal(SIGHUP, signal_entry);
363 -               prctl(PR_SET_PDEATHSIG, 0,0,0,0);
364 -       }
365  }
366  
367  BC_Signals::BC_Signals()
368 @@ -383,11 +373,13 @@ const char* BC_Signals::sig_to_str(int number)
369  #include <sys/wait.h>
370  #include "thread.h"
371  
372 +#define SC_(r)sc_##r
373 +
374  #if __i386__
375 -#define IP eip
376 +#define IP SC_(eip)
377  #endif
378  #if __x86_64__
379 -#define IP rip
380 +#define IP SC_(rip)
381  #endif
382  #ifndef IP
383  #error gotta have IP
384 @@ -473,26 +465,5 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
385  
386         fprintf(fp,"\n\n");
387         if( fp != stdout ) fclose(fp);
388 -       char cmd[1024], *cp = cmd;
389 -       cp += sprintf(cp, "exec gdb /proc/%d/exe -p %d --batch --quiet "
390 -               "-ex \"thread apply all info registers\" "
391 -               "-ex \"thread apply all bt full\" "
392 -               "-ex \"quit\"", pid, pid);
393 -       if( fp != stdout )
394 -               cp += sprintf(cp," >> \"%s\"", fn);
395 -       cp += sprintf(cp," 2>&1");
396 -//printf("handle_dump:: pid=%d, cmd='%s'  fn='%s'\n",pid,cmd,fn);
397 -        pid = vfork();
398 -        if( pid < 0 ) {
399 -               fprintf(stderr,"** can't start gdb, dump abondoned\n");
400 -               return;
401 -       }
402 -       if( pid > 0 ) {
403 -               waitpid(pid,0,0);
404 -               fprintf(stderr,"** dump complete\n");
405 -               return;
406 -       }
407 -        char *const argv[4] = { (char*) "/bin/sh", (char*) "-c", cmd, 0 };
408 -        execvp(argv[0], &argv[0]);
409  }
410  
411 diff --git a/cinelerra-5.1/guicast/filesystem.C b/cinelerra-5.1/guicast/filesystem.C
412 index ebc2007d..9d6452cb 100644
413 --- a/cinelerra-5.1/guicast/filesystem.C
414 +++ b/cinelerra-5.1/guicast/filesystem.C
415 @@ -33,6 +33,8 @@
416  #include <unistd.h>
417  #include <utime.h>
418  
419 +#define dirent64 dirent
420 +#define readdir64 readdir
421  
422  #include "filesystem.h"
423  
424 diff --git a/cinelerra-5.1/guicast/thread.C b/cinelerra-5.1/guicast/thread.C
425 index dff53e61..321ab4fc 100644
426 --- a/cinelerra-5.1/guicast/thread.C
427 +++ b/cinelerra-5.1/guicast/thread.C
428 @@ -55,13 +55,6 @@ void* Thread::entrypoint(void *parameters)
429         pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
430         thread->cancel_enabled = false;
431  
432 -// Set realtime here seince it doesn't work in start
433 -       if( thread->realtime && getuid() == 0 ) {
434 -               struct sched_param param = { sched_priority : 1 };
435 -               if(pthread_setschedparam(thread->tid, SCHED_RR, &param) < 0)
436 -                       perror("Thread::entrypoint pthread_attr_setschedpolicy");
437 -       }
438 -
439         thread->run();
440         thread->finished = true;
441         if( !thread->synchronous ) {
442 diff --git a/cinelerra-5.1/guicast/thread.h b/cinelerra-5.1/guicast/thread.h
443 index 216ecd2b..8ebec237 100644
444 --- a/cinelerra-5.1/guicast/thread.h
445 +++ b/cinelerra-5.1/guicast/thread.h
446 @@ -27,7 +27,7 @@
447  #include <unistd.h>
448  #include <sys/syscall.h>
449  
450 -static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
451 +static inline long gettid() { return (long)pthread_self(); }
452  
453  // The thread does not autodelete by default.
454  // If autodelete is 1 the thread autodeletes.
455 diff --git a/cinelerra-5.1/plugins/Makefile b/cinelerra-5.1/plugins/Makefile
456 index 6ed357c7..56081181 100644
457 --- a/cinelerra-5.1/plugins/Makefile
458 +++ b/cinelerra-5.1/plugins/Makefile
459 @@ -31,7 +31,6 @@ DIRS = $(OPENCV_OBJS) \
460         brightness \
461         burn \
462         C41 \
463 -       cdripper \
464         chromakey \
465         chromakeyhsv \
466         color3way \
467 @@ -161,6 +160,8 @@ DIRS = $(OPENCV_OBJS) \
468  #      denoisemjpeg \
469  # duplicate
470  #      vocoder \
471 +# not in bsd
472 +#      cdripper \
473  
474  PLUGIN_DIR = $(BINDIR)/plugins
475  DATA = $(PLUGIN_DIR)/fonts $(PLUGIN_DIR)/shapes
476 diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C
477 index fefbbdb1..045e96d4 100644
478 --- a/cinelerra-5.1/plugins/titler/titler.C
479 +++ b/cinelerra-5.1/plugins/titler/titler.C
480 @@ -57,8 +57,7 @@
481  #include <stdint.h>
482  #include <stdio.h>
483  #include <string.h>
484 -#include <endian.h>
485 -#include <byteswap.h>
486 +#include <sys/endian.h>
487  #include <iconv.h>
488  #include <sys/stat.h>
489  #include <fontconfig/fontconfig.h>