From c325b5e80a895dbff8e8ebb380c8fd2b8f7f4b1b Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 27 Jun 2018 10:35:15 +0900 Subject: [PATCH] Fix linux build caused by pull request #58 --- drivers/fet.c | 4 ++++ transport/rf2500.c | 2 +- transport/rf2500.h | 2 +- transport/rf2500hidapi.c | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/fet.c b/drivers/fet.c index 12ef2ca..51a03f2 100644 --- a/drivers/fet.c +++ b/drivers/fet.c @@ -43,7 +43,11 @@ static device_t fet_open_rf2500(const struct device_args *args) return NULL; } +#if defined(__APPLE__) + trans = rf2500hidapi_open(args->path, args->requested_serial); +#else trans = rf2500_open(args->path, args->requested_serial); +#endif if (!trans) return NULL; diff --git a/transport/rf2500.c b/transport/rf2500.c index aa175ae..468ebe4 100644 --- a/transport/rf2500.c +++ b/transport/rf2500.c @@ -228,7 +228,7 @@ static const struct transport_class rf2500_transport = { .set_modem = usbtr_set_modem }; -transport_t rf2500_libusb_open(const char *devpath, const char *requested_serial) +transport_t rf2500_open(const char *devpath, const char *requested_serial) { struct rf2500_transport *tr = malloc(sizeof(*tr)); struct usb_device *dev; diff --git a/transport/rf2500.h b/transport/rf2500.h index 1e5d75e..f523071 100644 --- a/transport/rf2500.h +++ b/transport/rf2500.h @@ -28,6 +28,6 @@ * A particular device may be specified in bus:dev form. */ transport_t rf2500_open(const char *dev_path, const char *requested_serial); -transport_t rf2500_libusb_open(const char *dev_path, const char *requested_serial); +transport_t rf2500hidapi_open(const char *dev_path, const char *requested_serial); #endif diff --git a/transport/rf2500hidapi.c b/transport/rf2500hidapi.c index 2795e11..d971f6c 100644 --- a/transport/rf2500hidapi.c +++ b/transport/rf2500hidapi.c @@ -161,7 +161,7 @@ static const wchar_t * get_wc(const char *c) return wc; } -transport_t rf2500_open(const char *devpath, const char *requested_serial) +transport_t rf2500hidapi_open(const char *devpath, const char *requested_serial) { struct rf2500_transport *tr = malloc(sizeof(*tr)); hid_device *handle; @@ -197,7 +197,7 @@ transport_t rf2500_open(const char *devpath, const char *requested_serial) free(tr); hid_exit(); printc_err("rf2500: fallback to libusb backend\n"); - return rf2500_libusb_open(devpath, requested_serial); + return rf2500_open(devpath, requested_serial); } tr->handle = handle;