From 9acccbb119976d0dfef2bdff60c9266fda978bc5 Mon Sep 17 00:00:00 2001 From: Denis Arnst Date: Fri, 10 May 2024 17:24:57 +0200 Subject: [PATCH] Do not require hid_version_str() Fixes #344 --- src/output.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/output.c b/src/output.c index 683c511..1a659ba 100644 --- a/src/output.c +++ b/src/output.c @@ -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; }