diff options
author | Guillem Jover <guillem@hadrons.org> | 2011-02-23 14:04:57 +0100 |
---|---|---|
committer | Guillem Jover <guillem@hadrons.org> | 2011-05-14 13:43:49 +0200 |
commit | 520682e59647eadf697e6384021e6781164b11b0 (patch) | |
tree | 7a1e1c747f7ac16e32fff4534391205a3a01fc9e /include/bsd | |
parent | 4c01261f3963c51ac0ee0f2b539cbf9298e8cc26 (diff) | |
download | libbsd-520682e59647eadf697e6384021e6781164b11b0.tar.gz |
Add support for transparent compilation
This means that software being ported should not need to be modified in
the usual case, as the libbsd headers will take over the standard
namespace and fill the missing gaps, and include the system headers.
To use this the new libbsd-transparent.pc file can be used through
pkg-config, which should end up doing the right thing.
Diffstat (limited to 'include/bsd')
-rw-r--r-- | include/bsd/err.h | 8 | ||||
-rw-r--r-- | include/bsd/getopt.h | 5 | ||||
-rw-r--r-- | include/bsd/stdio.h | 5 | ||||
-rw-r--r-- | include/bsd/stdlib.h | 9 | ||||
-rw-r--r-- | include/bsd/string.h | 6 | ||||
-rw-r--r-- | include/bsd/sys/cdefs.h | 4 | ||||
-rw-r--r-- | include/bsd/unistd.h | 6 |
7 files changed, 42 insertions, 1 deletions
diff --git a/include/bsd/err.h b/include/bsd/err.h index 489138b..b622655 100644 --- a/include/bsd/err.h +++ b/include/bsd/err.h @@ -29,9 +29,15 @@ #define LIBBSD_ERR_H #include <sys/cdefs.h> -#include <err.h> + #include <stdarg.h> +#ifdef LIBBSD_TRANSPARENT +#include_next <err.h> +#else +#include <err.h> +#endif + __BEGIN_DECLS extern void warnc (int code, const char *format, ...); extern void vwarnc (int code, const char *format, va_list ap); diff --git a/include/bsd/getopt.h b/include/bsd/getopt.h index 699a00e..b0057cf 100644 --- a/include/bsd/getopt.h +++ b/include/bsd/getopt.h @@ -29,7 +29,12 @@ #define LIBBSD_GETOPT_H #include <sys/cdefs.h> + +#ifdef LIBBSD_TRANSPARENT +#include_next <getopt.h> +#else #include <getopt.h> +#endif __BEGIN_DECLS extern int optreset; diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h index 882f374..dfde0c3 100644 --- a/include/bsd/stdio.h +++ b/include/bsd/stdio.h @@ -29,7 +29,12 @@ #include <sys/cdefs.h> #include <sys/types.h> + +#ifdef LIBBSD_TRANSPARENT +#include_next <stdio.h> +#else #include <stdio.h> +#endif __BEGIN_DECLS const char *fmtcheck(const char *, const char *); diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h index bf30f36..6736ed1 100644 --- a/include/bsd/stdlib.h +++ b/include/bsd/stdlib.h @@ -32,10 +32,19 @@ #include <sys/cdefs.h> #include <sys/stat.h> #include <stdint.h> + +#ifdef LIBBSD_TRANSPARENT +#include_next <stdlib.h> +#else #include <stdlib.h> +#endif /* For compatibility with NetBSD, which defines humanize_number here. */ +#ifdef LIBBSD_TRANSPARENT #include <libutil.h> +#else +#include <bsd/libutil.h> +#endif /* FIXME: Temporary inclusions to avoid API breakage, will be removed soon. */ #include <bsd/stdio.h> diff --git a/include/bsd/string.h b/include/bsd/string.h index cf72cc0..edc16fc 100644 --- a/include/bsd/string.h +++ b/include/bsd/string.h @@ -30,6 +30,12 @@ #include <sys/cdefs.h> #include <sys/types.h> +#ifdef LIBBSD_TRANSPARENT +#include_next <string.h> +#else +#include <string.h> +#endif + /* FIXME: Temporary inclusion to avoid API breakage, will be removed soon. */ #include <bsd/stdio.h> diff --git a/include/bsd/sys/cdefs.h b/include/bsd/sys/cdefs.h index 4d9aa49..87d8a48 100644 --- a/include/bsd/sys/cdefs.h +++ b/include/bsd/sys/cdefs.h @@ -27,7 +27,11 @@ #ifndef LIBBSD_CDEFS_H #define LIBBSD_CDEFS_H +#ifdef LIBBSD_TRANSPARENT +#include_next <sys/cdefs.h> +#else #include <sys/cdefs.h> +#endif #ifndef __dead2 # define __dead2 diff --git a/include/bsd/unistd.h b/include/bsd/unistd.h index 2a22fbc..ac56787 100644 --- a/include/bsd/unistd.h +++ b/include/bsd/unistd.h @@ -30,6 +30,12 @@ #include <sys/cdefs.h> #include <sys/stat.h> +#ifdef LIBBSD_TRANSPARENT +#include_next <unistd.h> +#else +#include <unistd.h> +#endif + #ifndef S_ISTXT #define S_ISTXT S_ISVTX #endif |