mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-15 23:20:10 +02:00
Fix function declaration protection for glibc already providing them
On non-glibc based systems we cannot unconditionally use the __GLIBC_PREREQ macro as it gets expanded before evaluation. Instead, if it is undefined, define it to 0. We should also always declare these functions on non-glibc based systems. And on systems with a new enough glibc, which provides these functions, we should still provide the declarations if _GNU_SOURCE is *not* defined. Reported-by: Jörg Krause <joerg.krause@embedded.rocks>
This commit is contained in:
@@ -46,7 +46,8 @@ size_t strlcat(char *dst, const char *src, size_t siz);
|
||||
char *strnstr(const char *str, const char *find, size_t str_len);
|
||||
void strmode(mode_t mode, char *str);
|
||||
|
||||
#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
|
||||
#if !defined(__GLIBC__) || \
|
||||
(defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE)))
|
||||
void explicit_bzero(void *buf, size_t len);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
Reference in New Issue
Block a user