diff --git a/src/libsysprof/sysprof-backport-autocleanups.h b/src/libsysprof/sysprof-backport-autocleanups.h new file mode 100644 index 00000000..2ff37928 --- /dev/null +++ b/src/libsysprof/sysprof-backport-autocleanups.h @@ -0,0 +1,12 @@ +#pragma once + +#include "config.h" + +#ifndef HAVE_POLKIT_AUTOPTR +# include + + 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 + diff --git a/src/libsysprof/sysprof-helpers.c b/src/libsysprof/sysprof-helpers.c index 87d0061a..740806fe 100644 --- a/src/libsysprof/sysprof-helpers.c +++ b/src/libsysprof/sysprof-helpers.c @@ -26,6 +26,7 @@ #include #include "sysprof-helpers.h" +#include "sysprof-backport-autocleanups.h" #include "helpers.h" #include "ipc-service.h"