summaryrefslogtreecommitdiff
path: root/lib/sflow_api.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-11-06 14:42:32 -0800
committerBen Pfaff <blp@ovn.org>2017-12-22 12:58:02 -0800
commitb2befd5bb2db811ac0273bc52be158d3476a5ff7 (patch)
tree1c4e11f4cabdf80e2904b8268b5f3a2daafae3a9 /lib/sflow_api.h
parent9041097aeec97b41f8a2d607e2c72a99b4f60d6a (diff)
downloadopenvswitch-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 'lib/sflow_api.h')
-rw-r--r--lib/sflow_api.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sflow_api.h b/lib/sflow_api.h
index 2730a4cf4..7264fc1c5 100644
--- a/lib/sflow_api.h
+++ b/lib/sflow_api.h
@@ -13,18 +13,18 @@
callback in sfl_agent_init.*/
/* #define SFLOW_DO_SOCKET */
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#include <sys/types.h>
-#include <arpa/inet.h> /* for htonl */
#ifdef SFLOW_DO_SOCKET
#include <sys/socket.h>
#include <netinet/in_systm.h>
-#include <netinet/in.h>
#include <netinet/ip.h>
#endif