Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Add LIBBSD_DISABLE_DEPRECATED to deprecated headers
Browse files Browse the repository at this point in the history
When enabled this will make the inclusion of deprecated headers a
fatal error so that it's easier to spot.
  • Loading branch information
guillemj committed May 29, 2011
1 parent fbd6229 commit 200eeb1
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/bsd/cdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 4 additions & 0 deletions include/bsd/inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 4 additions & 0 deletions include/bsd/ip_icmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 4 additions & 0 deletions include/bsd/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 4 additions & 0 deletions include/bsd/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 4 additions & 0 deletions include/libutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 4 additions & 0 deletions include/nlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 4 additions & 0 deletions include/vis.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down

0 comments on commit 200eeb1

Please sign in to comment.