Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx> --- src/util/virsocketaddr.h | 45 +++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h index 5230cddf64..b2ecb3c748 100644 --- a/src/util/virsocketaddr.h +++ b/src/util/virsocketaddr.h @@ -16,17 +16,16 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRSOCKETADDR_H -# define LIBVIRT_VIRSOCKETADDR_H +#pragma once -# include <netinet/in.h> -# include <sys/socket.h> -# ifdef HAVE_SYS_UN_H -# include <sys/un.h> -# endif +#include <netinet/in.h> +#include <sys/socket.h> +#ifdef HAVE_SYS_UN_H +# include <sys/un.h> +#endif -# include "internal.h" -# include "virautoclean.h" +#include "internal.h" +#include "virautoclean.h" /* On architectures which lack these limits, define them (ie. Cygwin). * Note that the libvirt code should be robust enough to handle the @@ -34,11 +33,11 @@ * length correctly in second argument to gethostname and by always * using strncpy instead of strcpy). */ -# ifndef INET_ADDRSTRLEN -# define INET_ADDRSTRLEN 16 -# endif +#ifndef INET_ADDRSTRLEN +# define INET_ADDRSTRLEN 16 +#endif -# define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1" +#define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1" typedef struct { union { @@ -46,27 +45,27 @@ typedef struct { struct sockaddr_storage stor; struct sockaddr_in inet4; struct sockaddr_in6 inet6; -# ifdef HAVE_SYS_UN_H +#ifdef HAVE_SYS_UN_H struct sockaddr_un un; -# endif +#endif } data; socklen_t len; } virSocketAddr; -# define VIR_SOCKET_ADDR_VALID(s) \ +#define VIR_SOCKET_ADDR_VALID(s) \ ((s)->data.sa.sa_family != AF_UNSPEC) -# define VIR_SOCKET_ADDR_IS_FAMILY(s, f) \ +#define VIR_SOCKET_ADDR_IS_FAMILY(s, f) \ ((s)->data.sa.sa_family == f) -# define VIR_SOCKET_ADDR_FAMILY(s) \ +#define VIR_SOCKET_ADDR_FAMILY(s) \ ((s)->data.sa.sa_family) -# define VIR_SOCKET_ADDR_IPV4_ALL "0.0.0.0" -# define VIR_SOCKET_ADDR_IPV6_ALL "::" +#define VIR_SOCKET_ADDR_IPV4_ALL "0.0.0.0" +#define VIR_SOCKET_ADDR_IPV6_ALL "::" -# define VIR_SOCKET_ADDR_IPV4_ARPA "in-addr.arpa" -# define VIR_SOCKET_ADDR_IPV6_ARPA "ip6.arpa" +#define VIR_SOCKET_ADDR_IPV4_ARPA "in-addr.arpa" +#define VIR_SOCKET_ADDR_IPV6_ARPA "ip6.arpa" typedef virSocketAddr *virSocketAddrPtr; @@ -161,5 +160,3 @@ int virSocketAddrPTRDomain(const virSocketAddr *addr, void virSocketAddrFree(virSocketAddrPtr addr); VIR_DEFINE_AUTOPTR_FUNC(virSocketAddr, virSocketAddrFree); - -#endif /* LIBVIRT_VIRSOCKETADDR_H */ -- 2.20.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list