mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-06-26 06:25:24 +02:00
Gracefully handle lack of system <sys/cdefs.h>
This is the case on musl. Fixes: https://bugs.debian.org/810589
This commit is contained in:
parent
368af99f55
commit
db7470b048
@ -24,15 +24,40 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* 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
|
#ifdef LIBBSD_OVERLAY
|
||||||
|
/*
|
||||||
|
* Some libc implementations do not have a <sys/cdefs.h>, in particular
|
||||||
|
* musl, try to handle this gracefully.
|
||||||
|
*/
|
||||||
|
#if __has_include_next(<sys/cdefs.h>)
|
||||||
#include_next <sys/cdefs.h>
|
#include_next <sys/cdefs.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
|
#if __has_include(<sys/cdefs.h>)
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef LIBBSD_SYS_CDEFS_H
|
#ifndef LIBBSD_SYS_CDEFS_H
|
||||||
#define 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.
|
* Some kFreeBSD headers expect those macros to be set for sanity checks.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user