From db7470b048a14bdc69a34fbd192ec626e1786411 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 10 Jan 2017 04:27:25 +0100 Subject: [PATCH] Gracefully handle lack of system This is the case on musl. Fixes: https://bugs.debian.org/810589 --- include/bsd/sys/cdefs.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/bsd/sys/cdefs.h b/include/bsd/sys/cdefs.h index 75d3955..044f221 100644 --- a/include/bsd/sys/cdefs.h +++ b/include/bsd/sys/cdefs.h @@ -24,15 +24,40 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __has_include +#define __has_include 1 +#endif +#ifndef __has_include_next +#define __has_include_next 1 +#endif + #ifdef LIBBSD_OVERLAY +/* + * Some libc implementations do not have a , in particular + * musl, try to handle this gracefully. + */ +#if __has_include_next() #include_next +#endif #else +#if __has_include() #include #endif +#endif #ifndef LIBBSD_SYS_CDEFS_H #define LIBBSD_SYS_CDEFS_H +#ifndef __BEGIN_DECLS +#ifdef __cplusplus +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#else +#define __BEGIN_DECLS +#define __END_DECLS +#endif +#endif + /* * Some kFreeBSD headers expect those macros to be set for sanity checks. */ -- 2.47.2