From: Gerhard Sittig Date: Tue, 29 Dec 2020 17:31:38 +0000 (+0100) Subject: dmm/bm52x: unbreak build when serial comm is not available X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f93bf8ba02995081312c448df7aeaf25b1118033;p=libsigrok.git dmm/bm52x: unbreak build when serial comm is not available Make another code path in the Brymen BM52x packet parser optional which snuck in earlier and broke compilation when serial_comm dependencies are not met. Ideally the src/dmm/ parser code would not get built at all in that case, but building a parser with reduced functionality and not using it later because its callers are conditional is as good, and is what other DMM packet parsers did in the past. How to reproduce: $ configure --without-libserialport --without-libhidapi --without-libbluez $ make --- diff --git a/src/dmm/bm52x.c b/src/dmm/bm52x.c index 69c01719..b91cb4e4 100644 --- a/src/dmm/bm52x.c +++ b/src/dmm/bm52x.c @@ -649,6 +649,7 @@ static uint16_t bm52x_rec_checksum(const uint8_t *b, size_t l) * Retrieve the first/next chunk of recording information. * Support for live readings is theoretical, and unused/untested. */ +#ifdef HAVE_SERIAL_COMM static int bm52x_rec_next_rsp(struct sr_serial_dev_inst *serial, enum bm52x_reqtype req, struct brymen_bm52x_state *state) { @@ -726,6 +727,17 @@ static int bm52x_rec_next_rsp(struct sr_serial_dev_inst *serial, return SR_OK; } +#else /* have serial comm */ +static int bm52x_rec_next_rsp(struct sr_serial_dev_inst *serial, + enum bm52x_reqtype req, struct brymen_bm52x_state *state) +{ + (void)serial; + (void)req; + (void)state; + (void)bm52x_rec_checksum; + return SR_ERR_NA; +} +#endif /* have serial comm */ /** Make sure a minimum amount of response data is available. */ static const uint8_t *bm52x_rec_ensure(struct sr_serial_dev_inst *serial,