Files
sysprof/src/libsysprof/sysprof-backport-autocleanups.h
2019-05-29 15:13:00 -07:00

24 lines
659 B
C

#pragma once
#include "config.h"
#include <glib.h>
#ifndef HAVE_POLKIT_AUTOPTR
# include <polkit/polkit.h>
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthority, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthorizationResult, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
#endif
#if !GLIB_CHECK_VERSION(2, 56, 0)
# define g_clear_handle_id(ptr, clear_func) \
G_STMT_START { \
guint __ptr = *(ptr); \
*(ptr) = 0; \
if (__ptr != 0) \
clear_func (__ptr); \
} G_STMT_END
#endif