Ensure Subsurface still compiles with libdivecomputer 0.4.x

The OSTC3 functions we need were introduced in 0.5.0 (more specifically,
in commit 56e2dec7266e71e725604a4a8bff5e61f3d62259).

Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
Thiago Macieira 2014-08-17 10:06:06 -07:00
parent 4e99382c96
commit 1b866e67f3

View file

@ -58,6 +58,7 @@ void ReadSettingsThread::run()
if (rc == DC_STATUS_SUCCESS) {
DeviceDetails *m_deviceDetails = new DeviceDetails(0);
switch (dc_device_get_type(m_data->device)) {
#if DC_VERSION_CHECK(0, 5, 0)
case DC_FAMILY_HW_OSTC3:
supported = true;
m_deviceDetails->setBrightness(0);
@ -296,7 +297,7 @@ void ReadSettingsThread::run()
emit devicedetails(m_deviceDetails);
break;
#endif // divecomputer 0.5.0
}
dc_device_close(m_data->device);
@ -328,6 +329,7 @@ void WriteSettingsThread::run()
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
if (rc == DC_STATUS_SUCCESS) {
switch (dc_device_get_type(m_data->device)) {
#if DC_VERSION_CHECK(0,5,0)
case DC_FAMILY_HW_OSTC3:
supported = true;
//write gas values
@ -493,7 +495,7 @@ void WriteSettingsThread::run()
}
break;
#endif // divecomputer 0.5.0
}
dc_device_close(m_data->device);
@ -522,10 +524,12 @@ void FirmwareUpdateThread::run()
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
if (rc == DC_STATUS_SUCCESS) {
switch (dc_device_get_type(m_data->device)) {
#if DC_VERSION_CHECK(0, 5, 0)
case DC_FAMILY_HW_OSTC3:
supported = true;
//hw_ostc3_device_fwupdate(m_data->device, m_fileName.toUtf8().data());
break;
#endif // divecomputer 0.5.0
}
dc_device_close(m_data->device);