1b65e20084b175467838246d03f85f5494f47526
[openwrt.git] / tools / mkimage / patches / 100-portability.patch
1 --- a/tools/kwbimage.c
2 +++ b/tools/kwbimage.c
3 @@ -206,6 +206,30 @@ INVL_DATA:
4 exit (EXIT_FAILURE);
5 }
6
7 +#ifndef __GLIBC__
8 +#ifndef __FreeBSD__
9 +static ssize_t
10 +getline(char **line, size_t *len, FILE *fd)
11 +{
12 + char *tmp;
13 + int tmplen;
14 +
15 + tmp = fgetln(fd, &tmplen);
16 + if (!tmp)
17 + return -1;
18 +
19 + if (!*line || tmplen > *len) {
20 + *len = tmplen + 1;
21 + *line = realloc(*line, *len);
22 + }
23 +
24 + strncpy(*line, tmp, tmplen);
25 + line[tmplen] = 0;
26 + return tmplen;
27 +}
28 +#endif
29 +#endif
30 +
31 /*
32 * this function sets the kwbimage header by-
33 * 1. Abstracting input command line arguments data
34 --- a/include/image.h
35 +++ b/include/image.h
36 @@ -49,6 +49,10 @@
37
38 #endif /* USE_HOSTCC */
39
40 +#ifndef ulong
41 +#define ulong unsigned long
42 +#endif
43 +
44 #include <command.h>
45
46 #if defined(CONFIG_FIT)
This page took 0.040412 seconds and 3 git commands to generate.