[perl-glib] Fix compilation and testing against glib < 2.28.0



commit ce8983b4c23aca5fc581d092e47b639f58dd4f86
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun Jan 6 16:32:46 2019 +0100

    Fix compilation and testing against glib < 2.28.0
    
    Do not try to use/test g_variant_lookup_value if glib is not new enough.
    
    https://rt.cpan.org/Ticket/Display.html?id=127831

 GVariant.xs | 4 ++++
 t/variant.t | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/GVariant.xs b/GVariant.xs
index 814c6c5..01bcf8a 100644
--- a/GVariant.xs
+++ b/GVariant.xs
@@ -497,9 +497,13 @@ gsize g_variant_n_children (GVariant *value);
 
 GVariant_noinc * g_variant_get_child_value (GVariant *value, gsize index_);
 
+#if GLIB_CHECK_VERSION (2, 28, 0)
+
 # gboolean g_variant_lookup (GVariant *dictionary, const gchar *key, const gchar *format_string, ...);
 GVariant_noinc * g_variant_lookup_value (GVariant *dictionary, const gchar *key, const GVariantType 
*expected_type);
 
+#endif
+
 # FIXME:
 # gconstpointer g_variant_get_fixed_array (GVariant *value, gsize *n_elements, gsize element_size);
 
diff --git a/t/variant.t b/t/variant.t
index 717ba2d..daeabea 100644
--- a/t/variant.t
+++ b/t/variant.t
@@ -205,7 +205,9 @@ note ('new_dict_entry');
 }
 
 note ('lookup_value');
-{
+SKIP: {
+  skip 'lookup_value', 3
+    unless Glib->CHECK_VERSION (2, 28, 0);
   my $entries = [map { Glib::Variant->new_dict_entry (Glib::Variant->new_string ($_->[0]),
                                                       Glib::Variant->new_byte ($_->[1])) }
                      (['one' => 1], ['two' => 2], ['four' => 4], ['eight' => 8])];


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