[Github-comments] [geany/geany-plugins] git-changebar: fix compatibility with libgit2 0.28 API (#821)
Colomban Wendling
notifications at xxxxx
Tue Feb 12 23:03:02 UTC 2019
b4n requested changes on this pull request.
Otherwise looks good, although I didn't test it yet (will try to do tomorrow).
> @@ -45,6 +45,10 @@
new_buffer, new_len, new_as_path, options, \
file_cb, hunk_cb, line_cb, payload)
#endif
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 28
Please use the same kind of checks used above, i.e.
```suggestion
#if ! defined (LIBGIT2_SOVERSION) || LIBGIT2_SOVERSION < 28
```
it's consistent, and properly handles versions before those macros were introduced.
> @@ -45,6 +45,10 @@
new_buffer, new_len, new_as_path, options, \
file_cb, hunk_cb, line_cb, payload)
#endif
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 28
+#define git_buf_dispose(x) git_buf_free(x)
+#define git_error_last() giterr_last()
Insert a space between `#` and `define` as indentation showing it's nested in the `#if` (as the similar ones above)
> @@ -45,6 +45,10 @@
new_buffer, new_len, new_as_path, options, \
file_cb, hunk_cb, line_cb, payload)
#endif
+#if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR < 28
+#define git_buf_dispose(x) git_buf_free(x)
+#define git_error_last() giterr_last()
there's also no need to include arguments as they are identical, it would be enough to do
```c
# define git_buf_dispose git_buf_free
# define git_error_last giterr_last
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/821#pullrequestreview-202951728
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190212/69c4f054/attachment.html>
More information about the Github-comments
mailing list