From 4033d1fd0f25196f9a35e944679676277cd51960 Mon Sep 17 00:00:00 2001 From: Alex Burmashev Date: Wed, 10 Mar 2021 08:49:54 -0500 Subject: Fix compilation for older gcc Signed-off-by: Alex Burmashev --- include/system/string.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/system') diff --git a/include/system/string.h b/include/system/string.h index 66e7d93e..2b366df7 100644 --- a/include/system/string.h +++ b/include/system/string.h @@ -64,7 +64,11 @@ mkbi3_(int, strncasecmp, const char *, s1, const char *, s2, size_t, n) mkbi3_(char *, strncat, char *, dest, const char *, src, size_t, n) mkbi3_(int, strncmp, const char *, s1, const char *, s2, size_t, n) mkbi3_(char *, strncpy, char *, dest, const char *, src, size_t, n) -mkbi2_(int, strnlen, const char *, s1, size_t, n) +#if defined(__GNUC__) && __GNUC__ >= 9 +mkbi2_(size_t, strnlen, const char *, s1, size_t, n) +#else +size_t strnlen(const char * s1, size_t n); +#endif mkdepbi2_(char *, strpbrk, const char *, s, const char *, accept) mkdepbi2_(char *, strrchr, const char *, s, int, c) mkdepbi2_(size_t, strspn, const char *, s, const char *, accept) -- cgit v1.2.3