]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Move overlay inclusions outside of header protection
authorGuillem Jover <guillem@hadrons.org>
Tue, 3 Jan 2012 04:39:22 +0000 (05:39 +0100)
committerGuillem Jover <guillem@hadrons.org>
Tue, 29 May 2012 02:51:04 +0000 (04:51 +0200)
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>
include/bsd/err.h
include/bsd/getopt.h
include/bsd/stdio.h
include/bsd/stdlib.h
include/bsd/string.h
include/bsd/sys/cdefs.h
include/bsd/sys/endian.h
include/bsd/sys/poll.h
include/bsd/unistd.h

index def4ac3295c5f3513846b1ab939fd253a57a604f..11d1250ef776b6a429c4aa8b7ecbfc60ff428c42 100644 (file)
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef LIBBSD_OVERLAY
+#include_next <err.h>
+#else
+#include <err.h>
+#endif
+
 #ifndef LIBBSD_ERR_H
 #define LIBBSD_ERR_H
 
 
 #include <stdarg.h>
 
-#ifdef LIBBSD_OVERLAY
-#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);
index 52a8f9c3da380c25cf0d8f08dff586c7516760c5..9fb2e7e03722630febe8a45a25fe1756dd5b4200 100644 (file)
@@ -24,9 +24,6 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef LIBBSD_GETOPT_H
-#define LIBBSD_GETOPT_H
-
 #ifdef LIBBSD_OVERLAY
 #include_next <getopt.h>
 #include <unistd.h>
@@ -34,5 +31,3 @@
 #include <getopt.h>
 #include <bsd/unistd.h>
 #endif
-
-#endif
index db2823e6d831c8b6854e1ddfca98fae62aa94eba..22e9d2c2396147265798bacf616770db4670d800 100644 (file)
  * 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
 #include_next <stdio.h>
 #else
 #include <stdio.h>
 #endif
 
+#ifndef LIBBSD_STDIO_H
+#define LIBBSD_STDIO_H
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
 __BEGIN_DECLS
 const char *fmtcheck(const char *, const char *);
 
index 5253183e24ef0d39a855e3f8166bdcd84d902fb2..5448011420724b27996207b895342e717b37cb0c 100644 (file)
  * 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
 #include_next <stdlib.h>
 #else
 #include <bsd/libutil.h>
 #endif
 
+#ifndef LIBBSD_STDLIB_H
+#define LIBBSD_STDLIB_H
+
+#include <sys/cdefs.h>
+#include <sys/stat.h>
+#include <stdint.h>
+
 __BEGIN_DECLS
 u_int32_t arc4random();
 void arc4random_stir();
index be811f3033d8a824a9c83729d5490b90194e5214..ac2a5a5a0c26163e1cc96ae01de7292d90472001 100644 (file)
  * 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
 #include_next <string.h>
 #else
 #include <string.h>
 #endif
 
+#ifndef LIBBSD_STRING_H
+#define LIBBSD_STRING_H
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
 __BEGIN_DECLS
 size_t strlcpy(char *dst, const char *src, size_t siz);
 size_t strlcat(char *dst, const char *src, size_t siz);
index 90b34c11debe58a1cce5218e0db25f798171e729..49bbeb510159f9d1293593d3d4cb0e198905b63e 100644 (file)
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef LIBBSD_SYS_CDEFS_H
-#define LIBBSD_SYS_CDEFS_H
-
 #ifdef LIBBSD_OVERLAY
 #include_next <sys/cdefs.h>
 #else
 #include <sys/cdefs.h>
 #endif
 
+#ifndef LIBBSD_SYS_CDEFS_H
+#define LIBBSD_SYS_CDEFS_H
+
 /*
  * Some kFreeBSD headers expect those macros to be set for sanity checks.
  */
index cf8c8846ab8987e9b1113b8d51b32aae15244190..3506cee26bf908fd72572e6c675f4c7c2dd58775 100644 (file)
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef LIBBSD_SYS_ENDIAN_H
-#define LIBBSD_SYS_ENDIAN_H
-
 #ifdef LIBBSD_OVERLAY
 #include_next <endian.h>
 #else
 #include <endian.h>
 #endif
 
+#ifndef LIBBSD_SYS_ENDIAN_H
+#define LIBBSD_SYS_ENDIAN_H
+
 #ifndef _BYTE_ORDER
 #define _BYTE_ORDER __BYTE_ORDER
 #endif
index 227effa929a6825468c67a47dae7986665a8d988..0e34103149d48c9ffdac9177abf35b0bbfa1aeda 100644 (file)
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef LIBBSD_SYS_POLL_H
-#define LIBBSD_SYS_POLL_H
-
 #ifdef LIBBSD_OVERLAY
 #include_next <sys/poll.h>
 #else
 #include <sys/poll.h>
 #endif
 
+#ifndef LIBBSD_SYS_POLL_H
+#define LIBBSD_SYS_POLL_H
+
 #ifndef INFTIM
 #define INFTIM (-1)
 #endif
index 713a8d74bbaaf2930b0b119167587729dbc9815e..e576b89c9453f5f3d46831772dd410a9feb79f80 100644 (file)
  * 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
 #include_next <unistd.h>
 #else
 #include <unistd.h>
 #endif
 
+#ifndef LIBBSD_UNISTD_H
+#define LIBBSD_UNISTD_H
+
+#include <sys/cdefs.h>
+#include <sys/stat.h>
+
 #ifndef S_ISTXT
 #define S_ISTXT S_ISVTX
 #endif