diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-04-01 18:04:03 -0700 |
---|---|---|
committer | Florian Fainelli <f.fainelli@gmail.com> | 2017-04-01 18:04:47 -0700 |
commit | 16750dd412020e7914113acc0664e6ba37f5bbf6 (patch) | |
tree | d61648585623a519eec8a3af8cda882bcfab6919 /utils/mpack/patches/001-use-stdlib.patch | |
parent | 0c432f890220053330cdaf74876c6d652bfb3c11 (diff) |
mpack: Fix conflicting malloc definition
Use stdlib.h for malloc(), getenv() and realloc(). Fixes the following
build failure:
unixos.c:42:14: error: conflicting types for 'malloc'
extern char *malloc();
^
Makefile:168: recipe for target 'unixos.o' failed
make[3]: *** [unixos.o] Error 1
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'utils/mpack/patches/001-use-stdlib.patch')
-rw-r--r-- | utils/mpack/patches/001-use-stdlib.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/mpack/patches/001-use-stdlib.patch b/utils/mpack/patches/001-use-stdlib.patch new file mode 100644 index 000000000..c5d10df7d --- /dev/null +++ b/utils/mpack/patches/001-use-stdlib.patch @@ -0,0 +1,34 @@ +Index: mpack-1.6/unixos.c +=================================================================== +--- mpack-1.6.orig/unixos.c ++++ mpack-1.6/unixos.c +@@ -25,6 +25,7 @@ + #include <stdio.h> + #include <ctype.h> + #include <string.h> ++#include <stdlib.h> + #include <errno.h> + #include <sys/types.h> + #include <sys/param.h> +@@ -39,8 +40,6 @@ + #endif + + extern int errno; +-extern char *malloc(); +-extern char *getenv(); + + int overwrite_files = 0; + int didchat; +Index: mpack-1.6/xmalloc.c +=================================================================== +--- mpack-1.6.orig/xmalloc.c ++++ mpack-1.6/xmalloc.c +@@ -24,7 +24,7 @@ + */ + #include <stdio.h> + #include <string.h> +-extern char *malloc(), *realloc(); ++#include <stdlib.h> + + char *xmalloc (int size) + { |