diff options
Diffstat (limited to 'meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch')
-rw-r--r-- | meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch b/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch new file mode 100644 index 0000000000..46ed956d0e --- /dev/null +++ b/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 26cc709291fc6c5d2e45b26c602407706d9142df Mon Sep 17 00:00:00 2001 | ||
2 | From: Imre Kaloz <kaloz@openwrt.org> | ||
3 | Date: Mon, 4 May 2015 15:36:34 +0200 | ||
4 | Subject: [PATCH] mtd-utils: libfec: use standard C type instead of u_long | ||
5 | |||
6 | Fixes compilation on hosts with the musl C library. | ||
7 | Also drops the unused u_short typedef. | ||
8 | |||
9 | Signed-off-by: Imre Kaloz <kaloz@openwrt.org> | ||
10 | Signed-off-by: Brian Norris <computersforpeace@gmail.com> | ||
11 | --- | ||
12 | Upstream-Status: Backport | ||
13 | |||
14 | lib/libfec.c | 8 +++----- | ||
15 | 1 file changed, 3 insertions(+), 5 deletions(-) | ||
16 | |||
17 | diff --git a/lib/libfec.c b/lib/libfec.c | ||
18 | index ff5a127..bf68381 100644 | ||
19 | --- a/lib/libfec.c | ||
20 | +++ b/lib/libfec.c | ||
21 | @@ -61,8 +61,6 @@ struct timeval { | ||
22 | }; | ||
23 | #define gettimeofday(x, dummy) { (x)->ticks = clock() ; } | ||
24 | #define DIFF_T(a,b) (1+ 1000000*(a.ticks - b.ticks) / CLOCKS_PER_SEC ) | ||
25 | -typedef unsigned long u_long ; | ||
26 | -typedef unsigned short u_short ; | ||
27 | #else /* typically, unix systems */ | ||
28 | #include <sys/time.h> | ||
29 | #define DIFF_T(a,b) \ | ||
30 | @@ -75,12 +73,12 @@ typedef unsigned short u_short ; | ||
31 | t = x.tv_usec + 1000000* (x.tv_sec & 0xff ) ; \ | ||
32 | } | ||
33 | #define TOCK(t) \ | ||
34 | - { u_long t1 ; TICK(t1) ; \ | ||
35 | + { unsigned long t1 ; TICK(t1) ; \ | ||
36 | if (t1 < t) t = 256000000 + t1 - t ; \ | ||
37 | else t = t1 - t ; \ | ||
38 | if (t == 0) t = 1 ;} | ||
39 | |||
40 | -u_long ticks[10]; /* vars for timekeeping */ | ||
41 | +unsigned long ticks[10]; /* vars for timekeeping */ | ||
42 | #else | ||
43 | #define DEB(x) | ||
44 | #define DDB(x) | ||
45 | @@ -625,7 +623,7 @@ init_fec(void) | ||
46 | #define FEC_MAGIC 0xFECC0DEC | ||
47 | |||
48 | struct fec_parms { | ||
49 | - u_long magic ; | ||
50 | + unsigned long magic ; | ||
51 | int k, n ; /* parameters of the code */ | ||
52 | gf *enc_matrix ; | ||
53 | } ; | ||
54 | -- | ||
55 | 2.6.0 | ||
56 | |||