From c664bbff2a72a60378bdc9053ee7183096535a26 Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Tue, 18 Jun 2019 11:12:57 -0500 Subject: [PATCH] util: dbus: use #pragma once in headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- src/util/virdbus.h | 22 ++++++++++------------ src/util/virdbuspriv.h | 11 ++++------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/util/virdbus.h b/src/util/virdbus.h index c1e5de31ab..083c074d59 100644 --- a/src/util/virdbus.h +++ b/src/util/virdbus.h @@ -19,19 +19,18 @@ * */ -#ifndef LIBVIRT_VIRDBUS_H -# define LIBVIRT_VIRDBUS_H +#pragma once -# ifdef WITH_DBUS -# undef interface /* Work around namespace pollution in mingw's rpc.h */ -# include -# else -# define DBusConnection void -# define DBusMessage void -# endif -# include "internal.h" +#ifdef WITH_DBUS +# undef interface /* Work around namespace pollution in mingw's rpc.h */ +# include +#else +# define DBusConnection void +# define DBusMessage void +#endif +#include "internal.h" -# include +#include void virDBusSetSharedBus(bool shared); @@ -75,4 +74,3 @@ int virDBusIsServiceEnabled(const char *name); int virDBusIsServiceRegistered(const char *name); bool virDBusErrorIsUnknownMethod(virErrorPtr err); -#endif /* LIBVIRT_VIRDBUS_H */ diff --git a/src/util/virdbuspriv.h b/src/util/virdbuspriv.h index 5c0c7f8b6e..f96f393ff5 100644 --- a/src/util/virdbuspriv.h +++ b/src/util/virdbuspriv.h @@ -23,12 +23,11 @@ # error "virdbuspriv.h may only be included by virdbus.c or test suites" #endif /* LIBVIRT_VIRDBUSPRIV_H_ALLOW */ -#ifndef LIBVIRT_VIRDBUSPRIV_H -# define LIBVIRT_VIRDBUSPRIV_H +#pragma once -# include "virdbus.h" +#include "virdbus.h" -# if defined(WITH_DBUS) && !HAVE_DBUSBASICVALUE +#if defined(WITH_DBUS) && !HAVE_DBUSBASICVALUE /* Copied (and simplified) from dbus 1.6.12, for use with older dbus headers */ typedef union { @@ -42,7 +41,7 @@ typedef union double dbl; /**< as double */ unsigned char byt; /**< as byte */ } DBusBasicValue; -# endif +#endif int virDBusMessageEncodeArgs(DBusMessage* msg, const char *types, @@ -55,5 +54,3 @@ int virDBusMessageDecodeArgs(DBusMessage* msg, int virDBusMessageEncode(DBusMessage* msg, const char *types, ...); - -#endif /* LIBVIRT_VIRDBUSPRIV_H */ -- GitLab