diff --git a/driver_garmin.c b/driver_garmin.c index 55d4a4e..662c9b4 100644 --- a/driver_garmin.c +++ b/driver_garmin.c @@ -283,8 +283,10 @@ static inline double radtodeg(double rad) static gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id, int pkt_len, unsigned char *buf); +#if defined(HAVE_LIBUSB) static gps_mask_t PrintUSBPacket(struct gps_device_t *session, Packet_t * pkt); +#endif /* HAVE_LIBUSB */ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id, int pkt_len, unsigned char *buf) @@ -621,6 +623,7 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id, } +#if defined(HAVE_LIBUSB) /*@ -branchstate @*/ // This works around cppcheck not looking into enough config branches // cppcheck-suppress unusedFunction @@ -729,9 +732,10 @@ static gps_mask_t PrintUSBPacket(struct gps_device_t *session, Packet_t * pkt) } /*@ +branchstate @*/ +#endif /* HAVE_LIBUSB */ -#if defined(__linux__) || defined(S_SPLINT_S) +#if defined(HAVE_LIBUSB) && (defined(__linux__) || defined(S_SPLINT_S)) /* build and send a packet w/ USB protocol */ static void Build_Send_USB_Packet(struct gps_device_t *session, uint32_t layer_id, uint32_t pkt_id, @@ -771,7 +775,7 @@ static void Build_Send_USB_Packet(struct gps_device_t *session, (void)gpsd_write(session, n, 0); } } -#endif /* __linux__ || S_SPLINT_S */ +#endif /* HAVE_LIBUSB && (__linux__ || S_SPLINT_S) */ /* build and send a packet in serial protocol */ /* layer_id unused */