diff --git a/app/src/usb/scrcpy_otg.c b/app/src/usb/scrcpy_otg.c index d3a45679..1eaa2537 100644 --- a/app/src/usb/scrcpy_otg.c +++ b/app/src/usb/scrcpy_otg.c @@ -91,8 +91,8 @@ scrcpy_otg(struct scrcpy_options *options) { usb_device_initialized = true; - LOGI("USB device: %s (%04" PRIx16 ":%04" PRIx16 ") %s %s", - usb_device.serial, usb_device.vid, usb_device.pid, + LOGI("USB device: %s (%04x:%04x) %s %s", usb_device.serial, + (unsigned) usb_device.vid, (unsigned) usb_device.pid, usb_device.manufacturer, usb_device.product); ok = sc_usb_connect(&s->usb, usb_device.device, &cbs, NULL); diff --git a/app/src/usb/usb.c b/app/src/usb/usb.c index 799ada94..2d3fc3a6 100644 --- a/app/src/usb/usb.c +++ b/app/src/usb/usb.c @@ -40,8 +40,9 @@ sc_usb_read_device(libusb_device *device, struct sc_usb_device *out) { if (result < 0) { // Log at debug level because it is expected that some non-Android USB // devices present on the computer require special permissions - LOGD("Open USB device %04" PRIx16 ":%04" PRIx16 ": libusb error: %s", - desc.idVendor, desc.idProduct, libusb_strerror(result)); + LOGD("Open USB device %04x:%04x: libusb error: %s", + (unsigned) desc.idVendor, (unsigned) desc.idProduct, + libusb_strerror(result)); return false; } @@ -146,8 +147,10 @@ sc_usb_devices_log(enum sc_log_level level, struct sc_usb_device *devices, for (size_t i = 0; i < count; ++i) { struct sc_usb_device *d = &devices[i]; const char *selection = d->selected ? "-->" : " "; - LOG(level, " %s %-18s (%04" PRIx16 ":%04" PRIx16 ") %s %s", - selection, d->serial, d->vid, d->pid, d->manufacturer, d->product); + // Convert uint16_t to unsigned because PRIx16 may not exist on Windows + LOG(level, " %s %-18s (%04x:%04x) %s %s", + selection, d->serial, (unsigned) d->vid, (unsigned) d->pid, + d->manufacturer, d->product); } }