]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Move VIR_AUTOUNREF definition to virobject.h
authorPeter Krempa <pkrempa@redhat.com>
Wed, 3 Apr 2019 11:37:26 +0000 (13:37 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 5 Apr 2019 16:07:51 +0000 (18:07 +0200)
This helper has solely to do with virObjects. Move it together with
other virObject stuff.

This also avoids the potential problem where VIR_AUTOUNREF uses
virObjectAutoUnref which is defined in virobject.h.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/viralloc.h
src/util/virobject.h

index a1708b772ce0bbab4dbf29bee1e75641cb8ac595..93ec36aae2dd599d215a4a683c3423970a354adb 100644 (file)
@@ -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 */
index 757068fcc149ecba19657e427cbecc2e6900c1b2..d13fc4b1ac2dd63ff65331e046a95aec8ae95125 100644 (file)
@@ -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);