summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-07-30 02:21:22 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2022-08-02 19:59:17 +0530
commitb1c8f70fa9b148b5fed77a6a1cacdbcf0c733601 (patch)
tree0b0f944c3d5fd9452241e6da6cf94dd997ae86b3
parent1cbffdb129ad97279d8b36d30a78f3f477bcae84 (diff)
downloadpygobject-b1c8f70fa9b148b5fed77a6a1cacdbcf0c733601.tar.gz
pygi: Fix girepository deprecation warnings
These functions were deprecated in gobject-introspection 1.72 GI_CHECK_VERSION was added after gobject-introspection 1.58, and we require 1.56. ../gi/pygi-closure.c: In function ‘_pygi_invoke_closure_free’: ../gi/pygi-closure.c:635:5: warning: ‘g_callable_info_free_closure’ is deprecated: Use 'g_callable_info_destroy_closure' instead [-Wdeprecated-declarations] 635 | g_callable_info_free_closure (invoke_closure->info, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../gi/pygi-closure.h:22, from ../gi/pygi-closure.c:20: /usr/include/gobject-introspection-1.0/girffi.h:106:15: note: declared here 106 | void g_callable_info_free_closure (GICallableInfo *callable_info, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../gi/pygi-closure.c: In function ‘_pygi_make_native_closure’: ../gi/pygi-closure.c:674:9: warning: ‘g_callable_info_prepare_closure’ is deprecated: Use 'g_callable_info_create_closure' instead [-Wdeprecated-declarations] 674 | g_callable_info_prepare_closure (info, &closure->cif, _pygi_closure_handle, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/gobject-introspection-1.0/girffi.h:100:15: note: declared here 100 | ffi_closure * g_callable_info_prepare_closure (GICallableInfo *callable_info, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rw-r--r--gi/pygi-closure.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gi/pygi-closure.c b/gi/pygi-closure.c
index 5504f241..49622777 100644
--- a/gi/pygi-closure.c
+++ b/gi/pygi-closure.c
@@ -24,6 +24,10 @@
#include "pygi-ccallback.h"
#include "pygi-info.h"
+#ifndef GI_CHECK_VERSION
+#define GI_CHECK_VERSION(x,y,z) 0
+#endif
+
extern PyObject *_PyGIDefaultArgPlaceholder;
typedef struct _PyGICallbackCache
@@ -634,8 +638,13 @@ void _pygi_invoke_closure_free (gpointer data)
{
PyGICClosure* invoke_closure = (PyGICClosure *) data;
+#if GI_CHECK_VERSION(1, 72, 0)
+ g_callable_info_destroy_closure (invoke_closure->info,
+ invoke_closure->closure);
+#else
g_callable_info_free_closure (invoke_closure->info,
invoke_closure->closure);
+#endif
if (invoke_closure->info)
g_base_info_unref ( (GIBaseInfo*) invoke_closure->info);
@@ -673,8 +682,13 @@ _pygi_make_native_closure (GICallableInfo* info,
Py_XINCREF (closure->user_data);
fficlosure =
+#if GI_CHECK_VERSION(1, 72, 0)
+ g_callable_info_create_closure (info, &closure->cif, _pygi_closure_handle,
+ closure);
+#else
g_callable_info_prepare_closure (info, &closure->cif, _pygi_closure_handle,
closure);
+#endif
closure->closure = fficlosure;
/* Give the closure the information it needs to determine when