Allow compilation on platforms without USBHID support

E.g. iOS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-02-12 12:21:07 -08:00
parent 8cf5209d31
commit 7444cca876
2 changed files with 12 additions and 0 deletions

View File

@ -26,7 +26,9 @@
#include "scubapro_g2.h"
#include "context-private.h"
#include "device-private.h"
#ifdef USBHID
#include "usbhid.h"
#endif
#include "array.h"
#include "platform.h"
@ -248,7 +250,11 @@ scubapro_g2_device_open(dc_device_t **out, dc_context_t *context, const char *na
status = DC_STATUS_IO;
goto error_free;
}
#ifdef USBHID
status = dc_usbhid_custom_io(context, id->vendor, id->device);
#else
status = DC_STATUS_UNSUPPORTED;
#endif
}
if (status != DC_STATUS_SUCCESS) {

View File

@ -28,7 +28,9 @@
#include "context-private.h"
#include "device-private.h"
#include "array.h"
#ifdef USBHID
#include "usbhid.h"
#endif
#include "platform.h"
#define EONSTEEL 0
@ -769,7 +771,11 @@ suunto_eonsteel_device_open(dc_device_t **out, dc_context_t *context, const char
/* We really need some way to specify USB ID's in the descriptor */
unsigned int vendor_id = 0x1493;
unsigned int device_id = model ? 0x0033 : 0x0030;
#ifdef USBHID
status = dc_usbhid_custom_io(context, vendor_id, device_id);
#else
status = DC_STATUS_UNSUPPORTED;
#endif
}
if (status != DC_STATUS_SUCCESS) {