mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
build: Do not redefine polkit autocleanup
PolkitAgent recently added autocleanup functions itself, so check
for their existence at configure time and only define our own when
they don't exist upstream.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5490
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2296>
(cherry picked from commit 1d0a08b5e2)
This commit is contained in:
parent
24a587cfd1
commit
9aa71ba928
3 changed files with 12 additions and 0 deletions
|
|
@ -33,3 +33,6 @@
|
|||
|
||||
/* Define if fdwalk is available in libc */
|
||||
#mesondefine HAVE_FDWALK
|
||||
|
||||
/* Define if polkit defines autocleanup functions */
|
||||
#mesondefine HAVE_POLKIT_AUTOCLEANUP
|
||||
|
|
|
|||
|
|
@ -169,6 +169,13 @@ cdata.set('HAVE_FDWALK',
|
|||
cc.has_function('fdwalk')
|
||||
)
|
||||
|
||||
polkit_has_autocleanup = cc.compiles(
|
||||
'#define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE
|
||||
#include <polkitagent/polkitagent.h>
|
||||
void main(void) { g_autoptr(PolkitAgentListener) agent = NULL; }',
|
||||
dependencies: polkit_dep)
|
||||
cdata.set('HAVE_POLKIT_AUTOCLEANUP', polkit_has_autocleanup)
|
||||
|
||||
buildtype = get_option('buildtype')
|
||||
if buildtype != 'plain'
|
||||
all_warnings = [
|
||||
|
|
|
|||
|
|
@ -14,8 +14,10 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#ifndef HAVE_POLKIT_AUTOCLEANUP
|
||||
/* Polkit doesn't have g_autoptr support, thus we have to manually set the autoptr function here */
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAgentListener, g_object_unref)
|
||||
#endif
|
||||
|
||||
#define SHELL_TYPE_POLKIT_AUTHENTICATION_AGENT (shell_polkit_authentication_agent_get_type())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue