From: Guillem Jover Date: Tue, 10 Jan 2017 03:27:25 +0000 (+0100) Subject: Gracefully handle lack of system X-Git-Tag: 0.8.4~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db7470b048a14bdc69a34fbd192ec626e1786411;p=thirdparty%2Flibbsd.git Gracefully handle lack of system This is the case on musl. Fixes: https://bugs.debian.org/810589 --- 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. */