From: Jonathon Jongsma Date: Tue, 18 Jun 2019 16:13:01 +0000 (-0500) Subject: util: object: use #pragma once in headers X-Git-Tag: v5.5.0-rc1~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1141bfd2593b04650a73c3c0bb76244ad0aef446;p=thirdparty%2Flibvirt.git util: object: use #pragma once in headers Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- diff --git a/src/util/virobject.h b/src/util/virobject.h index d13fc4b1ac..fe5dbe7326 100644 --- a/src/util/virobject.h +++ b/src/util/virobject.h @@ -19,11 +19,10 @@ * */ -#ifndef LIBVIRT_VIROBJECT_H -# define LIBVIRT_VIROBJECT_H +#pragma once -# include "internal.h" -# include "virthread.h" +#include "internal.h" +#include "virthread.h" typedef struct _virClass virClass; typedef virClass *virClassPtr; @@ -71,16 +70,16 @@ virClassPtr virClassForObject(void); virClassPtr virClassForObjectLockable(void); virClassPtr virClassForObjectRWLockable(void); -# ifndef VIR_PARENT_REQUIRED -# define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1) -# endif +#ifndef VIR_PARENT_REQUIRED +# define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1) +#endif /* Assign the class description nameClass to represent struct @name * (which must have an object-based 'parent' member at offset 0), and * with parent class @prnt. nameDispose must exist as either a * function or as a macro defined to NULL. */ -# define VIR_CLASS_NEW(name, prnt) \ +#define VIR_CLASS_NEW(name, prnt) \ verify_expr(offsetof(name, parent) == 0, \ (name##Class = virClassNew(prnt, #name, sizeof(name), \ sizeof(((name *)NULL)->parent), \ @@ -120,7 +119,7 @@ virObjectAutoUnref(void *objptr); * Declares a variable of @type which will be automatically unref'd when * control goes out of the scope. */ -# define VIR_AUTOUNREF(type) \ +#define VIR_AUTOUNREF(type) \ __attribute__((cleanup(virObjectAutoUnref))) type void * @@ -172,5 +171,3 @@ virObjectListFree(void *list); void virObjectListFreeCount(void *list, size_t count); - -#endif /* LIBVIRT_VIROBJECT_H */