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.
This commit is contained in:
Guillem Jover
2011-02-23 14:04:57 +01:00
parent 4c01261f39
commit 520682e596
14 changed files with 62 additions and 9 deletions

View File

@@ -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>