mirror of
https://git.proxmox.com/git/libgit2
synced 2025-12-30 22:59:52 +00:00
features: Rename _HAS_ to _FEATURE_
This commit is contained in:
parent
2491c416ed
commit
ebb3c506fd
@ -98,26 +98,26 @@ GIT_EXTERN(void) git_libgit2_version(int *major, int *minor, int *rev);
|
||||
* was compiled
|
||||
*/
|
||||
typedef enum {
|
||||
GIT_HAS_THREADS = (1 << 0),
|
||||
GIT_HAS_HTTPS = (1 << 1),
|
||||
GIT_HAS_SSH = (1 << 2),
|
||||
GIT_FEATURE_THREADS = (1 << 0),
|
||||
GIT_FEATURE_HTTPS = (1 << 1),
|
||||
GIT_FEATURE_SSH = (1 << 2),
|
||||
} git_feature_t;
|
||||
|
||||
/**
|
||||
* Query compile time options for libgit2.
|
||||
*
|
||||
* @return A combination of GIT_HAS_* values.
|
||||
* @return A combination of GIT_FEATURE_* values.
|
||||
*
|
||||
* - GIT_HAS_THREADS
|
||||
* - GIT_FEATURE_THREADS
|
||||
* Libgit2 was compiled with thread support. Note that thread support is
|
||||
* still to be seen as a 'work in progress' - basic object lookups are
|
||||
* believed to be threadsafe, but other operations may not be.
|
||||
*
|
||||
* - GIT_HAS_HTTPS
|
||||
* - GIT_FEATURE_HTTPS
|
||||
* Libgit2 supports the https:// protocol. This requires the openssl
|
||||
* library to be found when compiling libgit2.
|
||||
*
|
||||
* - GIT_HAS_SSH
|
||||
* - GIT_FEATURE_SSH
|
||||
* Libgit2 supports the SSH protocol for network operations. This requires
|
||||
* the openssh to be found when compiling libgit2
|
||||
*/
|
||||
|
||||
@ -21,13 +21,13 @@ int git_libgit2_features()
|
||||
{
|
||||
return 0
|
||||
#ifdef GIT_THREADS
|
||||
| GIT_HAS_THREADS
|
||||
| GIT_FEATURE_THREADS
|
||||
#endif
|
||||
#if defined(GIT_SSL) || defined(GIT_WINHTTP)
|
||||
| GIT_HAS_HTTPS
|
||||
| GIT_FEATURE_HTTPS
|
||||
#endif
|
||||
#if defined(GIT_SSH)
|
||||
| GIT_HAS_SSH
|
||||
| GIT_FEATURE_SSH
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
@ -12,20 +12,20 @@ void test_core_features__0(void)
|
||||
caps = git_libgit2_features();
|
||||
|
||||
#ifdef GIT_THREADS
|
||||
cl_assert((caps & GIT_HAS_THREADS) != 0);
|
||||
cl_assert((caps & GIT_FEATURE_THREADS) != 0);
|
||||
#else
|
||||
cl_assert((caps & GIT_HAS_THREADS) == 0);
|
||||
cl_assert((caps & GIT_FEATURE_THREADS) == 0);
|
||||
#endif
|
||||
|
||||
#if defined(GIT_SSL) || defined(GIT_WINHTTP)
|
||||
cl_assert((caps & GIT_HAS_HTTPS) != 0);
|
||||
cl_assert((caps & GIT_FEATURE_HTTPS) != 0);
|
||||
#else
|
||||
cl_assert((caps & GIT_HAS_HTTPS) == 0);
|
||||
cl_assert((caps & GIT_FEATURE_HTTPS) == 0);
|
||||
#endif
|
||||
|
||||
#if defined(GIT_SSH)
|
||||
cl_assert((caps & GIT_HAS_SSH) != 0);
|
||||
cl_assert((caps & GIT_FEATURE_SSH) != 0);
|
||||
#else
|
||||
cl_assert((caps & GIT_HAS_SSH) == 0);
|
||||
cl_assert((caps & GIT_FEATURE_SSH) == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user