From c1cd3c9830ce2c68dcf65342688e11a220723619 Mon Sep 17 00:00:00 2001 From: Sam James Date: Wed, 30 Aug 2023 02:32:13 +0100 Subject: 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 --- src/shared/helpers.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/shared') diff --git a/src/shared/helpers.h b/src/shared/helpers.h index 9cf263be..dee41b75 100644 --- a/src/shared/helpers.h +++ b/src/shared/helpers.h @@ -37,10 +37,8 @@ #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -#ifdef __GLIBC__ -# if !defined (__UCLIBC__) && !defined (__dietlibc__) +#ifndef HAVE_STRLCPY # define strlcpy(dst, src, size) snprintf(dst, size, "%s", src) -# endif #endif #ifndef timespecsub -- cgit v1.2.3