Skip to content

Commit

Permalink
Do not require hid_version_str()
Browse files Browse the repository at this point in the history
Fixes #344
  • Loading branch information
Sapd committed May 10, 2024
1 parent ea79eb1 commit 9acccbb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,14 @@ HeadsetControlStatus initializeStatus(int num_devices)
status.version = VERSION;
status.api_version = APIVERSION;
status.name = HEADSETCONTROL_NAME;
status.hid_version = hid_version_str();
status.device_count = num_devices;
#if defined(HID_API_VERSION_MAJOR)
// The `hid_version_str()` function is available
status.hid_version = hid_version_str();
#else
// `hid_version_str()` is not available, return a general version string or number
status.hid_version = "0.0.0";
#endif
status.device_count = num_devices;
return status;
}

Expand Down

0 comments on commit 9acccbb

Please sign in to comment.