diff --git a/src/util/viralloc.h b/src/util/viralloc.h index a1708b772c..93ec36aae2 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -682,15 +682,4 @@ void virAllocTestHook(void (*func)(int, void*), void *data); # define VIR_AUTOCLEAN(type) \ __attribute__((cleanup(VIR_AUTOCLEAN_FUNC_NAME(type)))) type - -/** - * VIR_AUTOUNREF: - * @type: type of an virObject subclass to be unref'd automatically - * - * Declares a variable of @type which will be automatically unref'd when - * control goes out of the scope. - */ -# define VIR_AUTOUNREF(type) \ - __attribute__((cleanup(virObjectAutoUnref))) type - #endif /* LIBVIRT_VIRALLOC_H */ diff --git a/src/util/virobject.h b/src/util/virobject.h index 757068fcc1..d13fc4b1ac 100644 --- a/src/util/virobject.h +++ b/src/util/virobject.h @@ -113,6 +113,16 @@ virObjectUnref(void *obj); void virObjectAutoUnref(void *objptr); +/** + * VIR_AUTOUNREF: + * @type: type of an virObject subclass to be unref'd automatically + * + * Declares a variable of @type which will be automatically unref'd when + * control goes out of the scope. + */ +# define VIR_AUTOUNREF(type) \ + __attribute__((cleanup(virObjectAutoUnref))) type + void * virObjectRef(void *obj);