]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Conditionalize temporary compatibility inclusions
authorGuillem Jover <guillem@hadrons.org>
Wed, 23 Feb 2011 11:38:42 +0000 (12:38 +0100)
committerGuillem Jover <guillem@hadrons.org>
Sat, 14 May 2011 12:18:22 +0000 (14:18 +0200)
These inclusions were in place for backward compatibility purposes,
when the headers were split so that code using them would not break.
Make it possible for applications to disable them by defining
LIBBSD_CLEAN_INCLUDES so that buildability can be tested and fixed
before they get removed in a subsequent release.

Makefile
include/bsd/stdlib.h
include/bsd/string.h
src/vis.c

index 05771b7461afaaccbd7c349f7751a3b7de1bbb69..94cf55c3884b4951028592a521d560d9c65bbd34 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -125,7 +125,9 @@ CFLAGS ?= -g -Wall -Wextra -Wno-unused-variable
 LDFLAGS ?=
 
 # Internal makefile variables
-MK_CPPFLAGS := -Iinclude/bsd/ -Iinclude/ -DLIBBSD_TRANSPARENT -D_GNU_SOURCE -D__REENTRANT
+MK_CPPFLAGS := -Iinclude/bsd/ -Iinclude/ \
+       -DLIBBSD_TRANSPARENT -DLIBBSD_CLEAN_INCLUDES \
+       -D_GNU_SOURCE -D__REENTRANT
 MK_CFLAGS :=
 MK_LDFLAGS :=
 
index 6736ed112ea5fbb209844a00a2d6c3253da1b13e..4a185fcc1f8deefae61fac883bd3969238c7cd9d 100644 (file)
 #endif
 
 /* FIXME: Temporary inclusions to avoid API breakage, will be removed soon. */
+#ifndef LIBBSD_CLEAN_INCLUDES
 #include <bsd/stdio.h>
 #include <bsd/unistd.h>
+#endif
 
 __BEGIN_DECLS
 u_int32_t arc4random();
index edc16fc18b19fb7d47293019686253f943ef3ea8..f9e733f7cd127126150526043b6b2fdc1d30808c 100644 (file)
 #include <string.h>
 #endif
 
+#ifndef LIBBSD_CLEAN_INCLUDES
 /* FIXME: Temporary inclusion to avoid API breakage, will be removed soon. */
 #include <bsd/stdio.h>
+#endif
 
 __BEGIN_DECLS
 size_t strlcpy(char *dst, const char *src, size_t siz);
index 6153a7fe10081213e3bf23d7c2950bfebd1ad4ef..f869ed814001b81d2a4fbf65dbc7f1d61c5e54ae 100644 (file)
--- a/src/vis.c
+++ b/src/vis.c
@@ -32,6 +32,7 @@
 #include <limits.h>
 #include <ctype.h>
 #include <string.h>
+#include <stdio.h>
 #include <vis.h>
 
 #define        isoctal(c)      (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')