mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
git_libgit2_version: return an int
Stop returning a void for functions, future-proofing them to allow them to fail.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user