summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-01-18 18:02:08 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2020-01-24 15:12:56 -0600
commit4cae9e712c4c068b01b132e43e8e381078fc4980 (patch)
treee7a53d446d5aab1d6d00b1f7074beb50cb7221b0
parentf78f6bd597bf0207a89d8defd4f0b9582830844c (diff)
downloadlibgit2-ethomson/no_void.tar.gz
git_libgit2_version: return an intethomson/no_void
Stop returning a void for functions, future-proofing them to allow them to fail.
-rw-r--r--include/git2/common.h3
-rw-r--r--src/settings.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/include/git2/common.h b/include/git2/common.h
index 947e40845..d6696061d 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -117,8 +117,9 @@ GIT_BEGIN_DECL
* @param major Store the major version number
* @param minor Store the minor version number
* @param rev Store the revision (patch) number
+ * @return 0 on success or an error code on failure
*/
-GIT_EXTERN(void) git_libgit2_version(int *major, int *minor, int *rev);
+GIT_EXTERN(int) git_libgit2_version(int *major, int *minor, int *rev);
/**
* Combinations of these values describe the features with which libgit2
diff --git a/src/settings.c b/src/settings.c
index 6fae49eaf..f9f6b8497 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -29,11 +29,13 @@
#include "streams/openssl.h"
#include "streams/mbedtls.h"
-void git_libgit2_version(int *major, int *minor, int *rev)
+int git_libgit2_version(int *major, int *minor, int *rev)
{
*major = LIBGIT2_VER_MAJOR;
*minor = LIBGIT2_VER_MINOR;
*rev = LIBGIT2_VER_REVISION;
+
+ return 0;
}
int git_libgit2_features(void)