Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would like #defines with exact hamlib version number #1209

Closed
jeffpc opened this issue Jan 7, 2023 · 1 comment
Closed

Would like #defines with exact hamlib version number #1209

jeffpc opened this issue Jan 7, 2023 · 1 comment
Labels
enhancement fixed Issue has been fixed
Milestone

Comments

@jeffpc
Copy link

jeffpc commented Jan 7, 2023

I'm trying to support more than just the latest version of hamlib which requires knowing which bugs are present in the used version and need workarounds. A common way of doing this is to compare the library-provide version number against a list of workarounds.

Something like this should do:

#define HAMLIB_VERSION_MAJOR 4
#define HAMLIB_VERSION_MINOR 5
#define HAMLIB_VERSION_PATCH 4

Maybe I missed it, but I didn't see anything like that in rig.h. Could you add these or something like them to allow for easy integer comparisons?

With these, I can then conditionally disable some functionality. E.g., KX2 power calculation doesn't work prior to 4.5.5 (I'm assuming the next version will be 4.5.5) or netrigctl prior to 4.3.1 may segfault in power2mW.

I realize that it won't help with already released versions, but it'd help with usage of future hamlib versions.

Note that hamlib_version contains "Hamlib 4.4" and therefore doesn't have enough granularity. (Also, parsing such a string in C is a headache compared to something like the #defines above.)

Thanks for taking a look.

@mdblack98 mdblack98 added this to the 4.6 milestone Jan 22, 2023
@mdblack98 mdblack98 added enhancement fixed Issue has been fixed labels Jan 22, 2023
@jeffpc
Copy link
Author

jeffpc commented Jan 22, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement fixed Issue has been fixed
Projects
None yet
Development

No branches or pull requests

2 participants