Allow compilation with libgit2 versions with >= minor version number

The major version must still be an exact match since libgit2 uses
semantic versioning and changes to the major number indicate backwards
incompatible changes to the API.

Fixes #695
This commit is contained in:
Sören Tempel 2020-11-28 19:27:29 +01:00
parent 7497529f70
commit 6ced15e1a4
3 changed files with 6 additions and 6 deletions

View File

@ -9,8 +9,8 @@ package git
#cgo CFLAGS: -DLIBGIT2_STATIC #cgo CFLAGS: -DLIBGIT2_STATIC
#include <git2.h> #include <git2.h>
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 1 #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 1
# error "Invalid libgit2 version; this git2go supports libgit2 v1.1" # error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.1.0"
#endif #endif
*/ */
import "C" import "C"

View File

@ -7,8 +7,8 @@ package git
#cgo CFLAGS: -DLIBGIT2_DYNAMIC #cgo CFLAGS: -DLIBGIT2_DYNAMIC
#include <git2.h> #include <git2.h>
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 1 #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 1
# error "Invalid libgit2 version; this git2go supports libgit2 v1.1" # error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.1.0"
#endif #endif
*/ */
import "C" import "C"

View File

@ -7,8 +7,8 @@ package git
#cgo CFLAGS: -DLIBGIT2_STATIC #cgo CFLAGS: -DLIBGIT2_STATIC
#include <git2.h> #include <git2.h>
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 1 #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 1 || LIBGIT2_VER_MINOR > 1
# error "Invalid libgit2 version; this git2go supports libgit2 v1.1" # error "Invalid libgit2 version; this git2go supports libgit2 between v1.1.0 and v1.1.0"
#endif #endif
*/ */
import "C" import "C"