From: Simon Ruderich Date: Mon, 2 Dec 2013 02:40:40 +0000 (+0100) Subject: Fix compile on FreeBSD. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=b00be87299cec58a3e1ffb6b3dd5deb60e7ccf31;p=socket2unix%2Fsocket2unix.git Fix compile on FreeBSD. --- diff --git a/src/socket2unix.c b/src/socket2unix.c index e912387..c90c864 100644 --- a/src/socket2unix.c +++ b/src/socket2unix.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -223,18 +222,28 @@ static const char *af_to_name(int af) { return "AF_INET6"; } else if (af == AF_IPX) { return "AF_IPX"; +#ifdef AF_NETLINK } else if (af == AF_NETLINK) { return "AF_NETLINK"; +#endif +#ifdef AF_X25 } else if (af == AF_X25) { return "AF_X25"; +#endif +#ifdef AF_AX25 } else if (af == AF_AX25) { return "AF_AX25"; +#endif +#ifdef AF_ATMPVC } else if (af == AF_ATMPVC) { return "AF_ATMPVC"; +#endif } else if (af == AF_APPLETALK) { return "AF_APPLETALK"; +#ifdef AF_PACKET } else if (af == AF_PACKET) { return "AF_PACKET"; +#endif } else { return "AF_UNKNOWN"; } @@ -250,8 +259,10 @@ static const char *sock_to_name(int sock) { return "SOCK_RAW"; } else if (sock & SOCK_RDM) { return "SOCK_RDM"; +#ifdef SOCK_PACKET } else if (sock & SOCK_PACKET) { return "SOCK_PACKET"; +#endif } else { return "SOCK_UNKNOWN"; } @@ -260,10 +271,14 @@ static const char *sock_to_name(int sock) { static const char *level_to_name(int level) { if (level == SOL_SOCKET) { return "SOL_SOCKET"; +#ifdef SOL_IP } else if (level == SOL_IP) { return "SOL_IP"; +#endif +#ifdef SOL_IPV6 } else if (level == SOL_IPV6) { return "SOL_IPV6"; +#endif } else if (level == IPPROTO_TCP) { return "IPPROTO_TCP"; } else if (level == IPPROTO_UDP) {