mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-16 18:56:56 +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:
@@ -58,6 +58,14 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* On non-glibc based systems, we cannot unconditionally use the
|
||||
* __GLIBC_PREREQ macro as it gets expanded before evaluation.
|
||||
*/
|
||||
#ifndef __GLIBC_PREREQ
|
||||
#define __GLIBC_PREREQ(maj, min) 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Some kFreeBSD headers expect those macros to be set for sanity checks.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user