diff options
author | Ben Pfaff <blp@ovn.org> | 2017-11-06 14:42:32 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-12-22 12:58:02 -0800 |
commit | b2befd5bb2db811ac0273bc52be158d3476a5ff7 (patch) | |
tree | 1c4e11f4cabdf80e2904b8268b5f3a2daafae3a9 /include/sparse/netinet | |
parent | 9041097aeec97b41f8a2d607e2c72a99b4f60d6a (diff) | |
download | openvswitch-b2befd5bb2db811ac0273bc52be158d3476a5ff7.tar.gz |
sparse: Add guards to prevent FreeBSD-incompatible #include order.
FreeBSD insists that <sys/types.h> be included before <netinet/in.h> and
that <netinet/in.h> be included before <arpa/inet.h>. This adds guards to
the "sparse" headers to yield a warning if this order is violated. This
commit also adjusts the order of many #includes to suit this requirement.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'include/sparse/netinet')
-rw-r--r-- | include/sparse/netinet/in.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sparse/netinet/in.h b/include/sparse/netinet/in.h index c28158ca0..6abdb2331 100644 --- a/include/sparse/netinet/in.h +++ b/include/sparse/netinet/in.h @@ -18,6 +18,12 @@ #error "Use this header only with sparse. It is not a correct implementation." #endif +#define NETINET_IN_H_INCLUDED 1 + +#ifndef SYS_TYPES_H_INCLUDED +#error "Must include <sys/types.h> before <netinet/in.h> for FreeBSD support" +#endif + #ifndef _NETINET_IN_H #define _NETINET_IN_H 1 |