Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | From b4c64b6f07743e3fb63ce52359bc664ab7d60df0 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 2 | From: Joshua Watt <JPEWhacker@gmail.com> |
| 3 | Date: Thu, 20 Feb 2020 15:20:45 -0600 |
| 4 | Subject: [PATCH] build: Fix strndup detection on MinGW |
| 5 | |
| 6 | GCC and meson conspire together to incorrectly detect that strndup() |
| 7 | exists on MinGW as __builtin_strndup, when no such function exists. As a |
| 8 | work around, meson will skip looking for __builtin functions if an |
| 9 | '#include' is in the prefix, so add '#include <string.h>' when looking |
| 10 | for strndup(). |
| 11 | |
| 12 | See: https://github.com/mesonbuild/meson/issues/3672 |
| 13 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/wayland/merge_requests/63] |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 15 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 16 | Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> |
| 17 | Signed-off-by: Denys Dmytriyenko <denis@denix.org> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | --- |
| 19 | meson.build | 2 +- |
| 20 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 21 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 22 | diff --git a/meson.build b/meson.build |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 23 | index 3bc25c9..adde7b9 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 24 | --- a/meson.build |
| 25 | +++ b/meson.build |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 26 | @@ -38,11 +38,11 @@ have_funcs = [ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 27 | 'prctl', |
| 28 | 'memfd_create', |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 29 | 'mremap', |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 30 | - 'strndup', |
| 31 | ] |
| 32 | foreach f: have_funcs |
| 33 | config_h.set('HAVE_' + f.underscorify().to_upper(), cc.has_function(f)) |
| 34 | endforeach |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 35 | +config_h.set('HAVE_STRNDUP', cc.has_function('strndup') and cc.has_header_symbol('string.h', 'strndup')) |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 36 | config_h.set10('HAVE_XUCRED_CR_PID', cc.has_member('struct xucred', 'cr_pid', prefix : '#include <sys/ucred.h>')) |
| 37 | have_broken_msg_cmsg_cloexec = false |
| 38 | if host_machine.system() == 'freebsd' |
| 39 | -- |
| 40 | 2.7.4 |
| 41 | |