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:
parent
7497529f70
commit
6ced15e1a4
|
@ -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"
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue