Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2012-12-05 23:56:27 +0400
committerVicent Marti <tanoku@gmail.com>2012-12-05 23:56:27 +0400
commitbf192cdb436f303c80bf7ff44307f301f981f0c6 (patch)
treebadd2d1d0f566a232f17265263cae9aa4511e99a /src/common.h
parent43efaabd40d8f9773a2fccb8acea704332446008 (diff)
versions: MSVC build fixes
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common.h b/src/common.h
index c7f4fdd96..211e5b543 100644
--- a/src/common.h
+++ b/src/common.h
@@ -68,21 +68,21 @@ int giterr_set_regex(const regex_t *regex, int error_code);
/**
* Check a versioned structure for validity
*/
-GIT_INLINE(bool) giterr__check_version(const void *structure, unsigned int expected_max, const char *name)
+GIT_INLINE(int) giterr__check_version(const void *structure, unsigned int expected_max, const char *name)
{
unsigned int actual;
if (!structure)
- return true;
+ return 0;
actual = *(const unsigned int*)structure;
if (actual > 0 && actual <= expected_max)
- return true;
+ return 0;
giterr_set(GITERR_INVALID, "Invalid version %d on %s", actual, name);
- return false;
+ return -1;
}
-#define GITERR_CHECK_VERSION(S,V,N) if (!giterr__check_version(S,V,N)) return -1
+#define GITERR_CHECK_VERSION(S,V,N) if (giterr__check_version(S,V,N) < 0) return -1
/**
* Initialize a structure with a version.