Skip to content

Commit 81adef8

Browse files
committed
io.c: Avoid warnings when building without logging
Follow-up of commit 057ae26 References libusb#1508 Fixes libusb#1630 Closes libusb#1752 Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
1 parent dcd30ce commit 81adef8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

libusb/io.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,8 +1370,10 @@ static int arm_timer_for_next_timeout(struct libusb_context *ctx)
13701370

13711371
/* act on first transfer that has not already been handled */
13721372
if (!(itransfer->timeout_flags & (USBI_TRANSFER_TIMEOUT_HANDLED | USBI_TRANSFER_OS_HANDLES_TIMEOUT))) {
1373+
#ifdef ENABLE_LOGGING
13731374
struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
13741375
usbi_dbg(ctx, "next timeout originally %ums", transfer->timeout);
1376+
#endif
13751377
return usbi_arm_timer(&ctx->timer, cur_ts);
13761378
}
13771379
}
@@ -1434,9 +1436,11 @@ static int add_to_flying_list(struct usbi_transfer *itransfer)
14341436
if (first && usbi_using_timer(ctx) && TIMESPEC_IS_SET(timeout)) {
14351437
/* if this transfer has the lowest timeout of all active transfers,
14361438
* rearm the timer with this transfer's timeout */
1439+
#ifdef ENABLE_LOGGING
14371440
struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
14381441
usbi_dbg(ctx, "arm timer for timeout in %ums (first in line)",
14391442
transfer->timeout);
1443+
#endif
14401444
r = usbi_arm_timer(&ctx->timer, timeout);
14411445
}
14421446
#else

0 commit comments

Comments
 (0)