scripts: fix compilation errors on darwin Add deprecated functions that are removed in darwin headers when _POSIX_C_SOURCE >= 200809L, `bcmp` and `strcasecmp`. Add `strset` that is defined when _POSIX_C_SOURCE >= __DARWIN_C_FULL, which unfortunately also brings in an incompatible definition of `uuid_t`. diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c index bc786c543..f4e0ec483 100644 --- a/scripts/dtc/dtc.c +++ b/scripts/dtc/dtc.c @@ -8,6 +8,8 @@ #include "dtc.h" #include "srcpos.h" +int strcasecmp(const char *s1, const char *s2); + /* * Command line options */ diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c index f5dfdb9d8..28922de4d 100644 --- a/scripts/genksyms/genksyms.c +++ b/scripts/genksyms/genksyms.c @@ -10,6 +10,7 @@ */ +#include #include #include #include diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 992575f1e..2b2fd5aa7 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -20,6 +20,8 @@ #include "lkc.h" +int bcmp(const void *b1, const void *b2, size_t len); + /* return true if 'path' exists, false otherwise */ static bool is_present(const char *path) { diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 2c80da022..dd087eb7d 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -23,6 +23,8 @@ #include "modpost.h" #include "../../include/linux/license.h" +char *strsep(char **stringp, const char *delim); + /* Are we using CONFIG_MODVERSIONS? */ static bool modversions; /* Is CONFIG_MODULE_SRCVERSION_ALL set? */ diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index 6bf9caca0..f25f4c783 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c @@ -10,6 +10,8 @@ #include #include "modpost.h" +char *strsep(char **stringp, const char *delim); + /* * Stolen form Cryptographic API. *