Skip to content

Commit

Permalink
Merge pull request #615 from drowe67/ms-hamlib-api-fix
Browse files Browse the repository at this point in the history
Check for RIGCAPS_NOT_CONST in Hamlib and update function definition as needed
  • Loading branch information
tmiw committed Nov 30, 2023
2 parents ef6d358 + 1b19f59 commit 5a99b8a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions USER_MANUAL.md
Expand Up @@ -916,6 +916,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes

1. Bugfixes:
* Use SetSize/GetSize instead of SetClientSize/GetClientSize to work around startup sizing issue. (PR #611)
* Check for RIGCAPS_NOT_CONST in Hamlib 4.6. (PR #615)

## V1.9.5 November 2023

Expand Down
6 changes: 5 additions & 1 deletion src/rig_control/HamlibRigController.cpp
Expand Up @@ -35,7 +35,11 @@ extern int g_verbose;
HamlibRigController::RigList HamlibRigController::RigList_;
std::mutex HamlibRigController::RigListMutex_;

int HamlibRigController::BuildRigList_(const struct rig_caps *rig, rig_ptr_t rigList) {
#if RIGCAPS_NOT_CONST
int HamlibRigController::BuildRigList_(struct rig_caps *rig, rig_ptr_t rigList) {
#else
int HamlibRigController::BuildRigList_(const struct rig_caps *rig, rig_ptr_t rigList) {
#endif // RIGCAPS_NOT_CONST
((HamlibRigController::RigList *)rigList)->push_back(rig);
return 1;
}
Expand Down
7 changes: 6 additions & 1 deletion src/rig_control/HamlibRigController.h
Expand Up @@ -96,9 +96,14 @@ class HamlibRigController : public ThreadedObject, public IRigFrequencyControlle

static RigList RigList_;
static std::mutex RigListMutex_;

static bool RigCompare_(const struct rig_caps *rig1, const struct rig_caps *rig2);

#if RIGCAPS_NOT_CONST
static int BuildRigList_(struct rig_caps *rig, rig_ptr_t);
#else
static int BuildRigList_(const struct rig_caps *rig, rig_ptr_t);
#endif // RIGCAPS_NOT_CONST
};

#endif // HAMLIB_RIG_CONTROLLER_H

0 comments on commit 5a99b8a

Please sign in to comment.