Include the correct deprecated headeres when using the overlay
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
diff --git a/include/bsd/cdefs.h b/include/bsd/cdefs.h
index 3039930..bbb6907 100644
--- a/include/bsd/cdefs.h
+++ b/include/bsd/cdefs.h
@@ -33,7 +33,11 @@
#warning "Deprecated header, use <bsd/sys/cdefs.h> or libbsd-overlay.pc instead."
#endif
+#ifdef LIBBSD_OVERLAY
+#include <sys/cdefs.h>
+#else
#include <bsd/sys/cdefs.h>
+#endif
#endif
diff --git a/include/bsd/ip_icmp.h b/include/bsd/ip_icmp.h
index 65f3ff7..0f34a5a 100644
--- a/include/bsd/ip_icmp.h
+++ b/include/bsd/ip_icmp.h
@@ -33,7 +33,11 @@
#warning "Deprecated header, use <bsd/netinet/ip_icmp.h> or libbsd-overlay.pc instead."
#endif
+#ifdef LIBBSD_OVERLAY
+#include <netinet/ip_icmp.h>
+#else
#include <bsd/netinet/ip_icmp.h>
+#endif
#endif
diff --git a/include/bsd/queue.h b/include/bsd/queue.h
index 30775ec..c479230 100644
--- a/include/bsd/queue.h
+++ b/include/bsd/queue.h
@@ -33,7 +33,11 @@
#warning "Deprecated header, use <bsd/sys/queue.h> or libbsd-overlay.pc instead."
#endif
+#ifdef LIBBSD_OVERLAY
+#include <sys/queue.h>
+#else
#include <bsd/sys/queue.h>
+#endif
#endif
diff --git a/include/bsd/random.h b/include/bsd/random.h
index 7b35f8b..3b90a66 100644
--- a/include/bsd/random.h
+++ b/include/bsd/random.h
@@ -33,7 +33,11 @@
#warning "Deprecated header, use <bsd/stdlib.h> instead."
#endif
+#ifdef LIBBSD_OVERLAY
+#include <stdlib.h>
+#else
#include <bsd/stdlib.h>
+#endif
#endif
diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
index 8e885f6..217a416 100644
--- a/include/bsd/stdlib.h
+++ b/include/bsd/stdlib.h
@@ -48,9 +48,14 @@
/* FIXME: Temporary inclusions to avoid API breakage, will be removed soon. */
#ifndef LIBBSD_DISABLE_DEPRECATED
+#ifdef LIBBSD_OVERLAY
+#include <stdio.h>
+#include <unistd.h>
+#else
#include <bsd/stdio.h>
#include <bsd/unistd.h>
#endif
+#endif
__BEGIN_DECLS
u_int32_t arc4random();
diff --git a/include/bsd/string.h b/include/bsd/string.h
index b0199d7..fb7d4a7 100644
--- a/include/bsd/string.h
+++ b/include/bsd/string.h
@@ -38,8 +38,12 @@
#ifndef LIBBSD_DISABLE_DEPRECATED
/* FIXME: Temporary inclusion to avoid API breakage, will be removed soon. */
+#ifdef LIBBSD_OVERLAY
+#include <stdio.h>
+#else
#include <bsd/stdio.h>
#endif
+#endif
__BEGIN_DECLS
size_t strlcpy(char *dst, const char *src, size_t siz);