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>
# 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 */
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);