We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A recent commit in Hamlib, broke the compilation of plugins/samplemimo/audiocatsiso/audiocatsisohamlib.cpp:
plugins/samplemimo/audiocatsiso/audiocatsisohamlib.cpp
AudioCatsIsoHamlib.cpp(24): error C2664: 'int rig_list_foreach(int (__cdecl *)(rig_caps *,void *),void *)': cannot convert argument 1 from 'int (__cdecl *)(const rig_caps *,void *)' to 'int (__cdecl *)(rig_caps *,void *)' AudioCatsIsoHamlib.cpp(24): note: None of the functions with this name in scope match the target type f:\gv\dx-radio\HamLib\include\hamlib/rig.h(3694): note: see declaration of 'rig_list_foreach' AudioCatsIsoHamlib.cpp(24): note: while trying to match the argument list '(overloaded-function, AudioCATSISOHamlib *)'
But now Hamlib has also a #define RIGCAPS_NOT_CONST to test for.
#define RIGCAPS_NOT_CONST
This is how I hacked around this issue:
--- a/audiocatsisohamlib.h 2023-12-10 11:49:04 +++ b/audiocatsisohamlib.h 2023-12-10 12:05:06 @@ -21,8 +21,19 @@ #define _AUDIOCATSISO_AUDIOCATSISOHAMLIB_H_ #include <QMap> +#include <hamlib/rig.h> -struct rig_caps; +#ifdef RIGCAPS_NOT_CONST + + /* Since this commit: + * https://github.com/Hamlib/Hamlib/commit/ed941939359da9f8734dbdf4a21a9b01622a1a6e + * a 'struct rig_caps' is no longer constant (as passed to 'rig_list_foreach()' etc.). + */ + + #define HAMLIB_RIG_CAPS struct rig_caps +#else + #define HAMLIB_RIG_CAPS const struct rig_caps +#endif class AudioCATSISOHamlib { @@ -36,7 +47,7 @@ private: QMap<uint32_t, QString> m_rigModels; QMap<QString, uint32_t> m_rigNames; - static int hash_model_list(const struct rig_caps *caps, void *data); + static int hash_model_list(HAMLIB_RIG_CAPS *caps, void *data); }; --- a/audiocatsisohamlib.cpp 2023-12-10 11:49:04 +++ b/audiocatsisohamlib.cpp 2023-12-10 12:03:32 @@ -17,7 +17,6 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // /////////////////////////////////////////////////////////////////////////////////// -#include <hamlib/rig.h> #include "audiocatsisohamlib.h" AudioCATSISOHamlib::AudioCATSISOHamlib() @@ -31,7 +30,7 @@ { } -int AudioCATSISOHamlib::hash_model_list(const struct rig_caps *caps, void *data) +int AudioCATSISOHamlib::hash_model_list(HAMLIB_RIG_CAPS *caps, void *data) { AudioCATSISOHamlib *hamlibHandler = (AudioCATSISOHamlib*) data; hamlibHandler->m_rigModels[caps->rig_model] = caps->model_name;
I'm on Win-10 using MSVC (x64).
The text was updated successfully, but these errors were encountered:
bb406ca
No branches or pull requests
A recent commit in Hamlib, broke the compilation of
plugins/samplemimo/audiocatsiso/audiocatsisohamlib.cpp
:But now Hamlib has also a
#define RIGCAPS_NOT_CONST
to test for.This is how I hacked around this issue:
I'm on Win-10 using MSVC (x64).
The text was updated successfully, but these errors were encountered: