VIR_STEAL_PTR copies the pointer from the second argument into the
first argument and then sets the second to NULL.
(a) = (a) ^ (b); \
} while (0)
+/**
+ * VIR_STEAL_PTR:
+ *
+ * Steals pointer passed as second argument into the first argument. Second
+ * argument must not have side effects.
+ */
+# define VIR_STEAL_PTR(a, b) \
+ do { \
+ (a) = (b); \
+ (b) = NULL; \
+ } while (0)
+
/**
* virCheckFlags:
* @supported: an OR'ed set of supported flags