- Notifications
You must be signed in to change notification settings - Fork2.5k
Add LIBGIT2_VER_CHECK Macro for Version Comparison#6882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
I think that this is generally useful. I'd rather see our version number be human-parseable in a way that reflects the version number. For example:
so that v1.8.2 is This also lets callers just say
which seems pretty readable to me. But I think that it's worth offering up a macro in case that'snot very readable. But I think that I would put it as something that evaluates to truthy given a version number. For example:
Then you'd use it as
|
For consistency, use LIBGIT2_VERSION_... as the constant name; deprecateLIBGIT2_VER_... names.
Thanks! I updated based on my suggestions. |
2ba1730
intolibgit2:mainUh oh!
There was an error while loading.Please reload this page.
This merge introduces a LIBGIT2_VERSION_CHECK macro in git2/version.h, similar to Qt's QT_VERSION_CHECK. The macro allows developers to compare the current version of libgit2 at compile time, making it easier to ensure compatibility with specific versions of the library.
Key Changes:
This enhancement will improve the ability to manage version-dependent code more efficiently. Please review the changes and provide feedback!