[perl-Glib] Fix compilation and test issues with Glib::Variant::ParseError



commit 3ef41686b13db61d3bf69bc0e365c99bf4a9f4e2
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun Aug 2 16:48:05 2015 +0200

    Fix compilation and test issues with Glib::Variant::ParseError
    
    GVariantParseError was introduced in glib 2.28, a bit later than
    GVariant.

 GError.xs      |    2 +-
 gperl-gtypes.c |    3 ++-
 t/variant.t    |    4 +++-
 3 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/GError.xs b/GError.xs
index 1de5306..7a05c19 100644
--- a/GError.xs
+++ b/GError.xs
@@ -369,7 +369,7 @@ BOOT:
        gperl_register_error_domain (G_THREAD_ERROR,
                                     GPERL_TYPE_THREAD_ERROR,
                                     "Glib::Thread::Error");
-#if GLIB_CHECK_VERSION (2, 24, 0)
+#if GLIB_CHECK_VERSION (2, 28, 0)
        /* gvariant.h */
        gperl_register_error_domain (G_VARIANT_PARSE_ERROR,
                                     GPERL_TYPE_VARIANT_PARSE_ERROR,
diff --git a/gperl-gtypes.c b/gperl-gtypes.c
index 79ec9f6..d58e99f 100644
--- a/gperl-gtypes.c
+++ b/gperl-gtypes.c
@@ -513,7 +513,8 @@ GType gperl_thread_error_get_type (void);
 
 /* -------------------------------------------------------------------------- */
 
-#if GLIB_CHECK_VERSION (2, 24, 0)
+/* The enum in its current form was added later than GVariant itself. */
+#if GLIB_CHECK_VERSION (2, 28, 0)
 
 GType
 gperl_variant_parse_error_get_type (void)
diff --git a/t/variant.t b/t/variant.t
index 8766e5a..d954788 100644
--- a/t/variant.t
+++ b/t/variant.t
@@ -225,7 +225,9 @@ note ('printing and parsing');
     is (Glib::Variant::parse ('y', $text)->get_byte, 23);
   }
 
-  {
+  SKIP: {
+    skip 'parse error tests', 1
+      unless Glib->CHECK_VERSION (2, 28, 0);
     my $text = 'byte 0x17';
     eval { Glib::Variant::parse ('b', $text)->get_byte };
     ok (Glib::Error::matches ($@, 'Glib::Variant::ParseError', 'type-error'));



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