diff options
Diffstat (limited to 'meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch')
-rw-r--r-- | meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch b/meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch deleted file mode 100644 index c4435875ad..0000000000 --- a/meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | From 3c8b4467a1ca229e72fb5223787ed400a19c65c0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joshua Watt <JPEWhacker@gmail.com> | ||
3 | Date: Fri, 25 Oct 2019 21:03:23 -0500 | ||
4 | Subject: [PATCH] scanner: Add configure check for strndup | ||
5 | |||
6 | Some platforms may not have strndup() (e.g. MinGW), so provide a | ||
7 | equivalent implementation if it's not found. | ||
8 | |||
9 | Upstream-Status: Accepted [4a1f348c20157db7bd7c759fdeb23fbe8729c571] | ||
10 | Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> | ||
11 | --- | ||
12 | configure.ac | 2 +- | ||
13 | src/scanner.c | 11 +++++++++++ | ||
14 | 2 files changed, 12 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/configure.ac b/configure.ac | ||
17 | index 8d56f2b..1c99e21 100644 | ||
18 | --- a/configure.ac | ||
19 | +++ b/configure.ac | ||
20 | @@ -63,7 +63,7 @@ fi | ||
21 | AC_SUBST(GCC_CFLAGS) | ||
22 | |||
23 | AC_CHECK_HEADERS([sys/prctl.h]) | ||
24 | -AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate prctl]) | ||
25 | +AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate prctl strndup]) | ||
26 | |||
27 | AC_ARG_ENABLE([libraries], | ||
28 | [AC_HELP_STRING([--disable-libraries], | ||
29 | diff --git a/src/scanner.c b/src/scanner.c | ||
30 | index a94be5d..27004bc 100644 | ||
31 | --- a/src/scanner.c | ||
32 | +++ b/src/scanner.c | ||
33 | @@ -916,6 +916,17 @@ verify_arguments(struct parse_context *ctx, | ||
34 | |||
35 | } | ||
36 | |||
37 | +#ifndef HAVE_STRNDUP | ||
38 | +char * | ||
39 | +strndup(const char *s, size_t size) | ||
40 | +{ | ||
41 | + char *r = malloc(size + 1); | ||
42 | + strncpy(r, s, size); | ||
43 | + r[size] = '\0'; | ||
44 | + return r; | ||
45 | +} | ||
46 | +#endif | ||
47 | + | ||
48 | static void | ||
49 | end_element(void *data, const XML_Char *name) | ||
50 | { | ||