Add LIBBSD_DISABLE_DEPRECATED to deprecated headers When enabled this will make the inclusion of deprecated headers a fatal error so that it's easier to spot.
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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
diff --git a/include/bsd/cdefs.h b/include/bsd/cdefs.h
index ac36e63..3039930 100644
--- a/include/bsd/cdefs.h
+++ b/include/bsd/cdefs.h
@@ -27,7 +27,11 @@
#ifndef LIBBSD_BSD_CDEFS_H
#define LIBBSD_BSD_CDEFS_H
+#ifdef LIBBSD_DISABLE_DEPRECATED
+#error "Deprecated header, use <bsd/sys/cdefs.h> or libbsd-overlay.pc instead."
+#else
#warning "Deprecated header, use <bsd/sys/cdefs.h> or libbsd-overlay.pc instead."
+#endif
#include <bsd/sys/cdefs.h>
diff --git a/include/bsd/inet.h b/include/bsd/inet.h
index 5f4862d..223baf5 100644
--- a/include/bsd/inet.h
+++ b/include/bsd/inet.h
@@ -27,7 +27,11 @@
#ifndef LIBBSD_INET_H
#define LIBBSD_INET_H
+#ifdef LIBBSD_DISABLE_DEPRECATED
+#error "Deprecated header, use <arpa/inet.h> instead."
+#else
#warning "Deprecated header, use <arpa/inet.h> instead."
+#endif
#include <arpa/inet.h>
diff --git a/include/bsd/ip_icmp.h b/include/bsd/ip_icmp.h
index 53e976a..65f3ff7 100644
--- a/include/bsd/ip_icmp.h
+++ b/include/bsd/ip_icmp.h
@@ -27,7 +27,11 @@
#ifndef LIBBSD_BSD_IP_ICMP_H
#define LIBBSD_BSD_IP_ICMP_H
+#ifdef LIBBSD_DISABLE_DEPRECATED
+#error "Deprecated header, use <bsd/netinet/ip_icmp.h> or libbsd-overlay.pc instead."
+#else
#warning "Deprecated header, use <bsd/netinet/ip_icmp.h> or libbsd-overlay.pc instead."
+#endif
#include <bsd/netinet/ip_icmp.h>
diff --git a/include/bsd/queue.h b/include/bsd/queue.h
index 56f5515..30775ec 100644
--- a/include/bsd/queue.h
+++ b/include/bsd/queue.h
@@ -27,7 +27,11 @@
#ifndef LIBBSD_BSD_QUEUE_H
#define LIBBSD_BSD_QUEUE_H
+#ifdef LIBBSD_DISABLE_DEPRECATED
+#error "Deprecated header, use <bsd/sys/queue.h> or libbsd-overlay.pc instead."
+#else
#warning "Deprecated header, use <bsd/sys/queue.h> or libbsd-overlay.pc instead."
+#endif
#include <bsd/sys/queue.h>
diff --git a/include/bsd/random.h b/include/bsd/random.h
index bfbd0ab..7b35f8b 100644
--- a/include/bsd/random.h
+++ b/include/bsd/random.h
@@ -27,7 +27,11 @@
#ifndef LIBBSD_RANDOM_H
#define LIBBSD_RANDOM_H
+#ifdef LIBBSD_DISABLE_DEPRECATED
+#error "Deprecated header, use <bsd/stdlib.h> instead."
+#else
#warning "Deprecated header, use <bsd/stdlib.h> instead."
+#endif
#include <bsd/stdlib.h>
diff --git a/include/libutil.h b/include/libutil.h
index f2196f7..a995c4a 100644
--- a/include/libutil.h
+++ b/include/libutil.h
@@ -27,7 +27,11 @@
#ifndef LIBBSD_LIBUTIL_H
#define LIBBSD_LIBUTIL_H
+#ifdef LIBBSD_DISABLE_DEPRECATED
+#error "Deprecated header, use <bsd/libutil.h> or libbsd-overlay.pc instead."
+#else
#warning "Deprecated header, use <bsd/libutil.h> or libbsd-overlay.pc instead."
+#endif
#include <bsd/libutil.h>
diff --git a/include/nlist.h b/include/nlist.h
index 9c5c5eb..ee576ae 100644
--- a/include/nlist.h
+++ b/include/nlist.h
@@ -27,7 +27,11 @@
#ifndef LIBBSD_NLIST_H
#define LIBBSD_NLIST_H
+#ifdef LIBBSD_DISABLE_DEPRECATED
+#error "Deprecated header, use <bsd/nlist.h> or libbsd-overlay.pc instead."
+#else
#warning "Deprecated header, use <bsd/nlist.h> or libbsd-overlay.pc instead."
+#endif
#include <bsd/nlist.h>
diff --git a/include/vis.h b/include/vis.h
index 564c10d..16f7976 100644
--- a/include/vis.h
+++ b/include/vis.h
@@ -27,7 +27,11 @@
#ifndef LIBBSD_VIS_H
#define LIBBSD_VIS_H
+#ifdef LIBBSD_DISABLE_DEPRECATED
+#error "Deprecated header, use <bsd/vis.h> or libbsd-overlay.pc instead."
+#else
#warning "Deprecated header, use <bsd/vis.h> or libbsd-overlay.pc instead."
+#endif
#include <bsd/vis.h>