mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 17:24:53 +00:00
util: object: use #pragma once in headers
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
ca92f950b1
commit
1141bfd259
@ -19,11 +19,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBVIRT_VIROBJECT_H
|
#pragma once
|
||||||
# define LIBVIRT_VIROBJECT_H
|
|
||||||
|
|
||||||
# include "internal.h"
|
#include "internal.h"
|
||||||
# include "virthread.h"
|
#include "virthread.h"
|
||||||
|
|
||||||
typedef struct _virClass virClass;
|
typedef struct _virClass virClass;
|
||||||
typedef virClass *virClassPtr;
|
typedef virClass *virClassPtr;
|
||||||
@ -71,16 +70,16 @@ virClassPtr virClassForObject(void);
|
|||||||
virClassPtr virClassForObjectLockable(void);
|
virClassPtr virClassForObjectLockable(void);
|
||||||
virClassPtr virClassForObjectRWLockable(void);
|
virClassPtr virClassForObjectRWLockable(void);
|
||||||
|
|
||||||
# ifndef VIR_PARENT_REQUIRED
|
#ifndef VIR_PARENT_REQUIRED
|
||||||
# define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1)
|
# define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1)
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
/* Assign the class description nameClass to represent struct @name
|
/* Assign the class description nameClass to represent struct @name
|
||||||
* (which must have an object-based 'parent' member at offset 0), and
|
* (which must have an object-based 'parent' member at offset 0), and
|
||||||
* with parent class @prnt. nameDispose must exist as either a
|
* with parent class @prnt. nameDispose must exist as either a
|
||||||
* function or as a macro defined to NULL.
|
* 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, \
|
verify_expr(offsetof(name, parent) == 0, \
|
||||||
(name##Class = virClassNew(prnt, #name, sizeof(name), \
|
(name##Class = virClassNew(prnt, #name, sizeof(name), \
|
||||||
sizeof(((name *)NULL)->parent), \
|
sizeof(((name *)NULL)->parent), \
|
||||||
@ -120,7 +119,7 @@ virObjectAutoUnref(void *objptr);
|
|||||||
* Declares a variable of @type which will be automatically unref'd when
|
* Declares a variable of @type which will be automatically unref'd when
|
||||||
* control goes out of the scope.
|
* control goes out of the scope.
|
||||||
*/
|
*/
|
||||||
# define VIR_AUTOUNREF(type) \
|
#define VIR_AUTOUNREF(type) \
|
||||||
__attribute__((cleanup(virObjectAutoUnref))) type
|
__attribute__((cleanup(virObjectAutoUnref))) type
|
||||||
|
|
||||||
void *
|
void *
|
||||||
@ -172,5 +171,3 @@ virObjectListFree(void *list);
|
|||||||
void
|
void
|
||||||
virObjectListFreeCount(void *list,
|
virObjectListFreeCount(void *list,
|
||||||
size_t count);
|
size_t count);
|
||||||
|
|
||||||
#endif /* LIBVIRT_VIROBJECT_H */
|
|
||||||
|
Loading…
Reference in New Issue
Block a user