aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-08-30 02:32:13 +0100
committerMike Frysinger <vapier@gmail.com>2023-08-29 23:31:18 -0400
commitc1cd3c9830ce2c68dcf65342688e11a220723619 (patch)
tree8ca1dfc6189c06851d3eb45763ca1be876e643fb /meson.build
parent86efc43d0e0d7569f5d2e7a58b8c461ac9f7dae8 (diff)
Don't re-define strlcpy/strlcat with >=glibc-2.38
`>=glibc-2.38` implements strlcpy, strlcat, etc so check for those functions with Meson and don't provide conflicting prototypes. Technically, it doesn't need _GNU_SOURCE, but it's easier because it's not clear right now what glibc wants to guard it with. Note that these are in POSIX next anyway. Fixes: https://github.com/OpenRC/openrc/issues/643 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build4
1 files changed, 4 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 3e94ce5d..73cb9778 100644
--- a/meson.build
+++ b/meson.build
@@ -203,6 +203,10 @@ if cc.has_function('close_range', prefix: '#define _GNU_SOURCE\n#include <unistd
add_project_arguments('-DHAVE_CLOSE_RANGE_CLOEXEC', language: 'c')
endif
+if cc.has_function('strlcpy', prefix: '#define _GNU_SOURCE\n#include <string.h>')
+ add_project_arguments('-DHAVE_STRLCPY', language: 'c')
+endif
+
incdir = include_directories('src/shared')
einfo_incdir = include_directories('src/libeinfo')
rc_incdir = include_directories('src/librc')