[vte] lib: Fix build without pcre2



commit c3fd98a57396b03bcfb00ac322b2d8c60f5b8048
Author: Christian Persch <chpe gnome org>
Date:   Tue Sep 29 23:34:24 2015 +0200

    lib: Fix build without pcre2

 src/vteregex.cc |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/vteregex.cc b/src/vteregex.cc
index 9d537e7..5df6152 100644
--- a/src/vteregex.cc
+++ b/src/vteregex.cc
@@ -90,12 +90,12 @@ set_gerror_from_pcre_error(int errcode,
 
 #else
 
-static void *
+static gboolean
 set_unsupported_error(GError **error)
 {
         g_set_error_literal(error, VTE_REGEX_ERROR, VTE_REGEX_ERROR_NOT_SUPPORTED,
                             "PCRE2 not supported");
-        return NULL;
+        return FALSE;
 }
 
 #endif /* WITH_PCRE2 */
@@ -197,7 +197,8 @@ vte_regex_new(const char *pattern,
 
         return regex_new(code);
 #else
-        return set_unsupported_error(error);
+        set_unsupported_error(error);
+        return NULL;
 #endif /* WITH_PCRE2 */
 }
 
@@ -226,7 +227,8 @@ vte_regex_new_pcre(pcre2_code_8 *code,
 
         return regex_new(code);
 #else
-        return set_unsupported_error(error);
+        set_unsupported_error(error);
+        return NULL;
 #endif
 }
 
@@ -286,6 +288,7 @@ vte_regex_jit(VteRegex *regex,
 gboolean
 _vte_regex_get_jited(VteRegex *regex)
 {
+#ifdef WITH_PCRE2
         PCRE2_SIZE s;
         int r;
 
@@ -294,4 +297,7 @@ _vte_regex_get_jited(VteRegex *regex)
         r = pcre2_pattern_info_8(regex->code, PCRE2_INFO_JITSIZE, &s);
 
         return r == 0 && s != 0;
+#else
+        return FALSE;
+#endif
 }


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