[geany/geany-plugins] 332639: git-changebar: Fix support for libgit2 0.19.0

Colomban Wendling git-noreply at xxxxx
Tue Feb 17 15:17:00 UTC 2015


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Tue, 17 Feb 2015 15:17:00 UTC
Commit:      332639f8585f0dbbbcd57d1c3d17865303b538cd
             https://github.com/geany/geany-plugins/commit/332639f8585f0dbbbcd57d1c3d17865303b538cd

Log Message:
-----------
git-changebar: Fix support for libgit2 0.19.0

libgit2 < 0.20 had incompatible API for diff callbacks, so it requires
some wrapping.


Modified Paths:
--------------
    git-changebar/src/gcb-plugin.c

Modified: git-changebar/src/gcb-plugin.c
27 lines changed, 27 insertions(+), 0 deletions(-)
===================================================================
@@ -36,6 +36,9 @@
 # define git_libgit2_init     git_threads_init
 # define git_libgit2_shutdown git_threads_shutdown
 #endif
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 20
+# define git_diff_hunk git_diff_range
+#endif
 
 
 GeanyPlugin      *geany_plugin;
@@ -569,6 +572,18 @@ diff_hunk_cb (const git_diff_delta *delta,
   
   return 0;
 }
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 20
+static int
+diff_hunk_cb_wrapper (const git_diff_delta *delta,
+                      const git_diff_hunk  *hunk,
+                      const char           *header,
+                      size_t                header_len,
+                      void                 *data)
+{
+  return diff_hunk_cb (delta, hunk, data);
+}
+# define diff_hunk_cb diff_hunk_cb_wrapper
+#endif
 
 static GtkWidget *
 get_widget_for_blob_range (GeanyDocument   *doc,
@@ -663,6 +678,18 @@ tooltip_diff_hunk_cb (const git_diff_delta *delta,
   
   return thd->found;
 }
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 20
+static int
+tooltip_diff_hunk_cb_wrapper (const git_diff_delta *delta,
+                              const git_diff_hunk  *hunk,
+                              const char           *header,
+                              size_t                header_len,
+                              void                 *data)
+{
+  return tooltip_diff_hunk_cb (delta, hunk, data);
+}
+# define tooltip_diff_hunk_cb tooltip_diff_hunk_cb_wrapper
+#endif
 
 static gboolean
 on_sci_query_tooltip (GtkWidget  *widget,



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list