summaryrefslogtreecommitdiffstats
path: root/testing/vdr/musl-compat.patch
blob: 04a1636e36a1f4d75c13be4c1704fa74a85fa8fd (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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
diff --git a/Makefile b/Makefile
index 0d3a8fc..43349ed 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ CXXFLAGS ?= -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses
 CDEFINES  = -D_GNU_SOURCE
 CDEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
 
-LIBS      = -ljpeg -lpthread -ldl -lcap -lrt $(shell pkg-config --libs freetype2 fontconfig)
+LIBS      = -ljpeg -lpthread -ldl -lcap -lrt -lintl $(shell pkg-config --libs freetype2 fontconfig)
 INCLUDES ?= $(shell pkg-config --cflags freetype2 fontconfig)
 
 # Directories:
diff --git a/PLUGINS/src/dvbsddevice/dvbsdffosd.c b/PLUGINS/src/dvbsddevice/dvbsdffosd.c
index 1a8caf8..b82cc52 100644
--- a/PLUGINS/src/dvbsddevice/dvbsdffosd.c
+++ b/PLUGINS/src/dvbsddevice/dvbsdffosd.c
@@ -10,7 +10,7 @@
 #include <linux/dvb/osd.h>
 #include <signal.h>
 #include <sys/ioctl.h>
-#include <sys/unistd.h>
+#include <unistd.h>
 #include <vdr/tools.h>
 
 // --- cDvbSdFfOsd -----------------------------------------------------------
diff --git a/font.c b/font.c
index cd2c494..0c052a1 100644
--- a/font.c
+++ b/font.c
@@ -433,7 +433,7 @@ bool cFont::GetAvailableFontNames(cStringList *FontNames, bool Monospaced)
 {
   if (!FontNames->Size()) {
      FcInit();
-     FcObjectSet *os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL);
+     FcObjectSet *os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, (char *)NULL);
      FcPattern *pat = FcPatternCreate();
      FcPatternAddBool(pat, FC_SCALABLE, FcTrue);
      if (Monospaced)
diff --git a/i18n.h b/i18n.h
index c3f1fc7..0ace2cd 100644
--- a/i18n.h
+++ b/i18n.h
@@ -17,6 +17,10 @@
 #define I18N_MAX_LOCALE_LEN 16       // for buffers that hold en_US etc.
 #define I18N_MAX_LANGUAGES  256      // for buffers that hold all available languages
 
+#ifndef __attribute_format_arg__
+#define __attribute_format_arg__(x)
+#endif
+
 void I18nInitialize(const char *LocaleDir = NULL);
    ///< Detects all available locales and loads the language names and codes.
    ///< If LocaleDir is given, it must point to a static string that lives
diff --git a/osd.c b/osd.c
index 7e52782..c372245 100644
--- a/osd.c
+++ b/osd.c
@@ -12,7 +12,7 @@
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
-#include <sys/unistd.h>
+#include <unistd.h>
 #include "device.h"
 #include "tools.h"
 
diff --git a/thread.c b/thread.c
index e5e19c9..fab13a2 100644
--- a/thread.c
+++ b/thread.c
@@ -143,7 +143,9 @@ cRwLock::cRwLock(bool PreferWriter)
 {
   pthread_rwlockattr_t attr;
   pthread_rwlockattr_init(&attr);
+  #if defined(PTHREAD_RWLOCK_PREFER_WRITER_NP) && defined(PTHREAD_RWLOCK_PREFER_READER_NP)
   pthread_rwlockattr_setkind_np(&attr, PreferWriter ? PTHREAD_RWLOCK_PREFER_WRITER_NP : PTHREAD_RWLOCK_PREFER_READER_NP);
+  #endif
   pthread_rwlock_init(&rwlock, &attr);
 }
 
@@ -179,7 +181,7 @@ cMutex::cMutex(void)
   locked = 0;
   pthread_mutexattr_t attr;
   pthread_mutexattr_init(&attr);
-  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
+  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
   pthread_mutex_init(&mutex, &attr);
 }
 
@@ -507,7 +509,7 @@ bool cPipe::Open(const char *Command, const char *Mode)
         int MaxPossibleFileDescriptors = getdtablesize();
         for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
             close(i); //close all dup'ed filedescriptors
-        if (execl("/bin/sh", "sh", "-c", Command, NULL) == -1) {
+        if (execl("/bin/sh", "sh", "-c", Command, (char *)NULL) == -1) {
            LOG_ERROR_STR(Command);
            close(fd[1 - iopipe]);
            _exit(-1);
@@ -590,7 +592,7 @@ int SystemExec(const char *Command, bool Detached)
      int MaxPossibleFileDescriptors = getdtablesize();
      for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
          close(i); //close all dup'ed filedescriptors
-     if (execl("/bin/sh", "sh", "-c", Command, NULL) == -1) {
+     if (execl("/bin/sh", "sh", "-c", Command, (char *)NULL) == -1) {
         LOG_ERROR_STR(Command);
         _exit(-1);
         }
diff --git a/tools.c b/tools.c
index a2055ec..31fb245 100644
--- a/tools.c
+++ b/tools.c
@@ -32,6 +32,11 @@ int SysLogLevel = 3;
 
 #define MAXSYSLOGBUF 256
 
+#ifndef ACCESSPERMS
+#   define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+
+
 void syslog_with_tid(int priority, const char *format, ...)
 {
   va_list ap;
@@ -618,7 +623,7 @@ char *ReadLink(const char *FileName)
 {
   if (!FileName)
      return NULL;
-  char *TargetName = canonicalize_file_name(FileName);
+  char *TargetName = realpath(FileName, NULL);
   if (!TargetName) {
      if (errno == ENOENT) // file doesn't exist
         TargetName = strdup(FileName);
diff --git a/tools.h b/tools.h
index 358f75e..2029e31 100644
--- a/tools.h
+++ b/tools.h
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <syslog.h>
+#include <limits.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 
@@ -31,6 +32,10 @@ typedef unsigned char uchar;
 
 extern int SysLogLevel;
 
+#ifndef DEFFILEMODE
+#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) /* 0666 */
+#endif
+
 #define esyslog(a...) void( (SysLogLevel > 0) ? syslog_with_tid(LOG_ERR,   a) : void() )
 #define isyslog(a...) void( (SysLogLevel > 1) ? syslog_with_tid(LOG_INFO,  a) : void() )
 #define dsyslog(a...) void( (SysLogLevel > 2) ? syslog_with_tid(LOG_DEBUG, a) : void() )
@@ -567,7 +572,7 @@ public:
         data[i] = T(0);
     size = 0;
   }
-  void Sort(__compar_fn_t Compare)
+  void Sort(int (* Compare)(const void *, const void *))
   {
     qsort(data, size, sizeof(T), Compare);
   }
diff --git a/vdr.c b/vdr.c
index 835d33d..977683d 100644
--- a/vdr.c
+++ b/vdr.c
@@ -610,9 +610,9 @@ int main(int argc, char *argv[])
      }
   else if (Terminal) {
      // Claim new controlling terminal
-     stdin  = freopen(Terminal, "r", stdin);
-     stdout = freopen(Terminal, "w", stdout);
-     stderr = freopen(Terminal, "w", stderr);
+     freopen(Terminal, "r", stdin);
+     freopen(Terminal, "w", stdout);
+     freopen(Terminal, "w", stderr);
      HasStdin = true;
      tcgetattr(STDIN_FILENO, &savedTm);
      }