mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-05-29 15:34:10 +02:00
Move overlay inclusions outside of header protection
Glibc tends to include standard headers with special definitions that make few declarations or macros visible, this stomps over the overlay #include_next <> logic. Based-on-patch-by: Robert Millan <rmh@debian.org>
This commit is contained in:
parent
f71d8e0501
commit
866f73af91
@ -25,6 +25,12 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef LIBBSD_OVERLAY
|
||||||
|
#include_next <err.h>
|
||||||
|
#else
|
||||||
|
#include <err.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef LIBBSD_ERR_H
|
#ifndef LIBBSD_ERR_H
|
||||||
#define LIBBSD_ERR_H
|
#define LIBBSD_ERR_H
|
||||||
|
|
||||||
@ -32,12 +38,6 @@
|
|||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
|
||||||
#include_next <err.h>
|
|
||||||
#else
|
|
||||||
#include <err.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
extern void warnc (int code, const char *format, ...);
|
extern void warnc (int code, const char *format, ...);
|
||||||
extern void vwarnc (int code, const char *format, va_list ap);
|
extern void vwarnc (int code, const char *format, va_list ap);
|
||||||
|
@ -24,9 +24,6 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBBSD_GETOPT_H
|
|
||||||
#define LIBBSD_GETOPT_H
|
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
#ifdef LIBBSD_OVERLAY
|
||||||
#include_next <getopt.h>
|
#include_next <getopt.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -34,5 +31,3 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <bsd/unistd.h>
|
#include <bsd/unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -24,18 +24,18 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBBSD_STDIO_H
|
|
||||||
#define LIBBSD_STDIO_H
|
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
#ifdef LIBBSD_OVERLAY
|
||||||
#include_next <stdio.h>
|
#include_next <stdio.h>
|
||||||
#else
|
#else
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LIBBSD_STDIO_H
|
||||||
|
#define LIBBSD_STDIO_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
const char *fmtcheck(const char *, const char *);
|
const char *fmtcheck(const char *, const char *);
|
||||||
|
|
||||||
|
@ -26,13 +26,6 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBBSD_STDLIB_H
|
|
||||||
#define LIBBSD_STDLIB_H
|
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
#ifdef LIBBSD_OVERLAY
|
||||||
#include_next <stdlib.h>
|
#include_next <stdlib.h>
|
||||||
#else
|
#else
|
||||||
@ -46,6 +39,13 @@
|
|||||||
#include <bsd/libutil.h>
|
#include <bsd/libutil.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LIBBSD_STDLIB_H
|
||||||
|
#define LIBBSD_STDLIB_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
u_int32_t arc4random();
|
u_int32_t arc4random();
|
||||||
void arc4random_stir();
|
void arc4random_stir();
|
||||||
|
@ -24,18 +24,18 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBBSD_STRING_H
|
|
||||||
#define LIBBSD_STRING_H
|
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
#ifdef LIBBSD_OVERLAY
|
||||||
#include_next <string.h>
|
#include_next <string.h>
|
||||||
#else
|
#else
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LIBBSD_STRING_H
|
||||||
|
#define LIBBSD_STRING_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
size_t strlcpy(char *dst, const char *src, size_t siz);
|
size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||||
|
@ -24,15 +24,15 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBBSD_SYS_CDEFS_H
|
|
||||||
#define LIBBSD_SYS_CDEFS_H
|
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
#ifdef LIBBSD_OVERLAY
|
||||||
#include_next <sys/cdefs.h>
|
#include_next <sys/cdefs.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LIBBSD_SYS_CDEFS_H
|
||||||
|
#define LIBBSD_SYS_CDEFS_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some kFreeBSD headers expect those macros to be set for sanity checks.
|
* Some kFreeBSD headers expect those macros to be set for sanity checks.
|
||||||
*/
|
*/
|
||||||
|
@ -24,15 +24,15 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBBSD_SYS_ENDIAN_H
|
|
||||||
#define LIBBSD_SYS_ENDIAN_H
|
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
#ifdef LIBBSD_OVERLAY
|
||||||
#include_next <endian.h>
|
#include_next <endian.h>
|
||||||
#else
|
#else
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LIBBSD_SYS_ENDIAN_H
|
||||||
|
#define LIBBSD_SYS_ENDIAN_H
|
||||||
|
|
||||||
#ifndef _BYTE_ORDER
|
#ifndef _BYTE_ORDER
|
||||||
#define _BYTE_ORDER __BYTE_ORDER
|
#define _BYTE_ORDER __BYTE_ORDER
|
||||||
#endif
|
#endif
|
||||||
|
@ -24,15 +24,15 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBBSD_SYS_POLL_H
|
|
||||||
#define LIBBSD_SYS_POLL_H
|
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
#ifdef LIBBSD_OVERLAY
|
||||||
#include_next <sys/poll.h>
|
#include_next <sys/poll.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LIBBSD_SYS_POLL_H
|
||||||
|
#define LIBBSD_SYS_POLL_H
|
||||||
|
|
||||||
#ifndef INFTIM
|
#ifndef INFTIM
|
||||||
#define INFTIM (-1)
|
#define INFTIM (-1)
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,18 +25,18 @@
|
|||||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBBSD_UNISTD_H
|
|
||||||
#define LIBBSD_UNISTD_H
|
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
#ifdef LIBBSD_OVERLAY
|
#ifdef LIBBSD_OVERLAY
|
||||||
#include_next <unistd.h>
|
#include_next <unistd.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LIBBSD_UNISTD_H
|
||||||
|
#define LIBBSD_UNISTD_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#ifndef S_ISTXT
|
#ifndef S_ISTXT
|
||||||
#define S_ISTXT S_ISVTX
|
#define S_ISTXT S_ISVTX
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user