diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/cd-common.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index e7821b1..5583076 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,10 @@ AM_CONDITIONAL(CD_BUILD_POLKIT, test x$enable_polkit = xyes) if test x$enable_polkit = xyes; then PKG_CHECK_MODULES(POLKIT, polkit-gobject-1 >= 0.103) AC_DEFINE(USE_POLKIT, 1, [if we should use PolicyKit]) + + PKG_CHECK_EXISTS([polkit-gobject-1 >= 0.114], + [AC_DEFINE(POLKIT_HAS_AUTOPTR_MACROS, 1, [if PolKit has autoptr macros])], + []) fi dnl --------------------------------------------------------------------------- diff --git a/src/cd-common.c b/src/cd-common.c index 7d2b3fb..62de666 100644 --- a/src/cd-common.c +++ b/src/cd-common.c @@ -29,13 +29,11 @@ #include "cd-common.h" -#ifdef USE_POLKIT -#ifndef PolkitAuthorizationResult_autoptr +#if defined(USE_POLKIT) && !defined(POLKIT_HAS_AUTOPTR_MACROS) G_DEFINE_AUTOPTR_CLEANUP_FUNC(PolkitAuthorizationResult, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(PolkitSubject, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(PolkitAuthority, g_object_unref) #endif -#endif /** * cd_client_error_quark: |