mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-08 11:02:24 +01:00
Guard non-portable forwarded includes
These headers are not available on Windows. <bsd/sys/cdefs.h> ensures that __has_include() and __has_include_next() are defined. Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
parent
2ebe6d5a02
commit
c2d9d84088
@ -26,20 +26,20 @@
|
||||
*/
|
||||
|
||||
#ifdef LIBBSD_OVERLAY
|
||||
#include <sys/cdefs.h>
|
||||
#if __has_include_next(<err.h>)
|
||||
#include_next <err.h>
|
||||
#endif
|
||||
#else
|
||||
#include <bsd/sys/cdefs.h>
|
||||
#if __has_include(<err.h>)
|
||||
#include <err.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LIBBSD_ERR_H
|
||||
#define LIBBSD_ERR_H
|
||||
|
||||
#ifdef LIBBSD_OVERLAY
|
||||
#include <sys/cdefs.h>
|
||||
#else
|
||||
#include <bsd/sys/cdefs.h>
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
@ -25,9 +25,15 @@
|
||||
*/
|
||||
|
||||
#ifdef LIBBSD_OVERLAY
|
||||
#include <sys/cdefs.h>
|
||||
#if __has_include_next(<getopt.h>)
|
||||
#include_next <getopt.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <bsd/sys/cdefs.h>
|
||||
#if __has_include(<getopt.h>)
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#include <bsd/unistd.h>
|
||||
#endif
|
||||
|
@ -27,10 +27,16 @@
|
||||
*/
|
||||
|
||||
#ifdef LIBBSD_OVERLAY
|
||||
#include <sys/cdefs.h>
|
||||
#if __has_include_next(<endian.h>)
|
||||
#include_next <endian.h>
|
||||
#endif
|
||||
#else
|
||||
#include <bsd/sys/cdefs.h>
|
||||
#if __has_include(<endian.h>)
|
||||
#include <endian.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LIBBSD_SYS_ENDIAN_H
|
||||
#define LIBBSD_SYS_ENDIAN_H
|
||||
|
@ -33,10 +33,16 @@
|
||||
*/
|
||||
|
||||
#ifdef LIBBSD_OVERLAY
|
||||
#include <sys/cdefs.h>
|
||||
#if __has_include_next(<sys/time.h>)
|
||||
#include_next <sys/time.h>
|
||||
#endif
|
||||
#else
|
||||
#include <bsd/sys/cdefs.h>
|
||||
#if __has_include(<sys/time.h>)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LIBBSD_SYS_TIME_H
|
||||
#define LIBBSD_SYS_TIME_H
|
||||
|
@ -26,19 +26,20 @@
|
||||
*/
|
||||
|
||||
#ifdef LIBBSD_OVERLAY
|
||||
#include <sys/cdefs.h>
|
||||
#if __has_include_next(<unistd.h>)
|
||||
#include_next <unistd.h>
|
||||
#endif
|
||||
#else
|
||||
#include <bsd/sys/cdefs.h>
|
||||
#if __has_include(<unistd.h>)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LIBBSD_UNISTD_H
|
||||
#define LIBBSD_UNISTD_H
|
||||
|
||||
#ifdef LIBBSD_OVERLAY
|
||||
#include <sys/cdefs.h>
|
||||
#else
|
||||
#include <bsd/sys/cdefs.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if !defined(S_ISTXT) && defined(S_ISVTX)
|
||||
|
Loading…
Reference in New Issue
Block a user