[perl-glib/ebassi/warnings: 3/6] Ignore deprecation warnings around g_object_newv()



commit fc05b276ec053a03e1cdc1ca86f4c84d1b369bf4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed May 20 14:14:54 2020 +0100

    Ignore deprecation warnings around g_object_newv()
    
    We're using the old vector-based API, which has been deprecated.
    
    Since we know that, let's disable the deprecation warnings, to avoid the
    compiler getting angry at us.

 GObject.xs | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/GObject.xs b/GObject.xs
index 1dfb88d..87054ca 100644
--- a/GObject.xs
+++ b/GObject.xs
@@ -1328,11 +1328,14 @@ g_object_new (class, ...)
        const char *class
     PREINIT:
        int n_params = 0;
+        G_GNUC_BEGIN_IGNORE_DEPRECATIONS
        GParameter * params = NULL;
+        G_GNUC_END_IGNORE_DEPRECATIONS
        GType object_type;
        GObject * object;
        GObjectClass *oclass = NULL;
     CODE:
+        G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 #define FIRST_ARG      1
        object_type = gperl_object_type_from_package (class);
        if (!object_type)
@@ -1381,6 +1384,7 @@ g_object_new (class, ...)
 #undef FIRST_ARG
 
        object = g_object_newv (object_type, n_params, params);
+        G_GNUC_END_IGNORE_DEPRECATIONS
 
        /* this wrapper *must* own this object!
         * because we've been through initialization, the perl object


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]