summaryrefslogtreecommitdiffstats
path: root/package/multicat/0002-Fix-musl-build.patch
blob: 07e15a353a0a7f9b8d52ab5965f2a04b7e0a7821 (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
Fix musl build

Defining _GNU_SOURCE is required to get proper member names in `struct udphdr`
when building against musl. Build error:

  util.c: In function 'RawFillHeaders':
  util.c:481:9: error: 'struct udphdr' has no member named 'source'
       udph->source = htons(portsrc);
           ^
  util.c:482:9: error: 'struct udphdr' has no member named 'dest'
       udph->dest   = htons(portdst);
           ^
  util.c:483:9: error: 'struct udphdr' has no member named 'len'
       udph->len    = htons(sizeof(struct udphdr) + len);
           ^
  util.c:484:9: error: 'struct udphdr' has no member named 'check'
       udph->check  = 0;

Including <sys/types.h> in needed for mode_t, otherwise musl build fails:
  util.h:91:1: error: unknown type name 'mode_t'

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Sent upstream: https://mailman.videolan.org/pipermail/multicat-devel/2016-March/000126.html

diff -purN multicat-2.1.orig/util.c multicat-2.1/util.c
--- multicat-2.1.orig/util.c	2015-07-17 18:03:17.000000000 +0200
+++ multicat-2.1/util.c	2016-03-19 22:21:01.110178772 +0100
@@ -21,6 +21,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
diff -purN multicat-2.1.orig/util.h multicat-2.1/util.h
--- multicat-2.1.orig/util.h	2015-07-15 22:47:39.000000000 +0200
+++ multicat-2.1/util.h	2016-03-19 22:21:58.649834990 +0100
@@ -21,6 +21,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#include <sys/types.h>
 #include <netinet/udp.h>
 #include <netinet/ip.h>
 
OpenPOWER on IntegriCloud