vmihalko / t2_polkit

Other
0 stars 0 forks source link

polkitagent: Add g_autoptr() support for GObject-derived types - [merged] #263

Closed vmihalko closed 1 year ago

vmihalko commented 4 years ago

In GitLab by @wisperwind on Apr 13, 2020, 01:03

_Merges polkitagentautoptr -> master

This fixes the same issue that commit 004bd37d fixed for the main polkit code in polkitagent. If these definition are not made, subclassing e.g. PolkitAgentListener using G_DECLARE_FINAL_TYPE/G_DECLARE_DERIVABLE_TYPE fails with errors like

/usr/include/glib-2.0/glib/gmacros.h:1028:49: error: ‘glib_autoptr_clear_PolkitAgentListener’ undeclared (first use in this function); did you mean ‘glib_autoptr_clear_GSocketListener’?
 1028 | #define _GLIB_AUTOPTR_CLEAR_FUNC_NAME(TypeName) glib_autoptr_clear_##TypeName
      |                                                 ^~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1051:64: note: in definition of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
 1051 |     { g_slist_free_full (*_l, (GDestroyNotify) (void(*)(void)) cleanup); }                                      \
      |                                                                ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1056:65: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
 1056 |   _GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS(ModuleObjName, ParentName, _GLIB_AUTOPTR_CLEAR_FUNC_NAME(ParentName))
      |                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtype.h:1408:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CHAINUP’
 1408 |   _GLIB_DEFINE_AUTOPTR_CHAINUP (ModuleObjName, ParentName)                                               \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/listener.h:11:1: note: in expansion of macro ‘G_DECLARE_FINAL_TYPE’
   11 | G_DECLARE_FINAL_TYPE (MyListener, my_listener, MY, LISTENER,
      | ^~~~~~~~~~~~~~~~~~~~
vmihalko commented 2 years ago

In GitLab by @jrybar on Apr 7, 2022, 14:40

Hello @wisperwind,

can you please rebase this, so we can merge it?
Thanks!

vmihalko commented 2 years ago

In GitLab by @wisperwind on Apr 8, 2022, 22:39

added 66 commits

Compare with previous version

vmihalko commented 2 years ago

In GitLab by @wisperwind on Apr 8, 2022, 22:42

Done. The project that I would have used this for is long dead, so I didn't and won't test that any of this still makes sense.