diff --git a/backend/pixma/pixma_bjnp.c b/backend/pixma/pixma_bjnp.c index 34ba918f2..fd41d5e96 100644 --- a/backend/pixma/pixma_bjnp.c +++ b/backend/pixma/pixma_bjnp.c @@ -109,6 +109,13 @@ #ifndef SSIZE_MAX # define SSIZE_MAX LONG_MAX #endif +#ifndef HOST_NAME_MAX +# ifdef _POSIX_HOST_NAME_MAX +# define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +# else +# define HOST_NAME_MAX 255 +# endif +#endif /* static data */ static bjnp_device_t device[BJNP_NO_DEVICES]; diff --git a/sanei/sanei_usb.c b/sanei/sanei_usb.c index fc8afda4d..8e8185a8f 100644 --- a/sanei/sanei_usb.c +++ b/sanei/sanei_usb.c @@ -1859,6 +1859,11 @@ static void libusb_scan_devices(void) continue; } +/* macOS won't configure several USB scanners (i.e. ScanSnap 300M) because their + * descriptors are vendor specific. As a result the device will get configured + * later during sanei_usb_open making it safe to ignore the configuration check + * here on these platforms. */ +#if !defined(__APPLE__) if (config == 0) { DBG (1, @@ -1866,6 +1871,7 @@ static void libusb_scan_devices(void) vid, pid, busno, address); continue; } +#endif ret = libusb_get_config_descriptor (dev, 0, &config0); if (ret < 0) @@ -2614,11 +2620,17 @@ sanei_usb_open (SANE_String_Const devname, SANE_Int * dn) return SANE_STATUS_INVAL; } +/* macOS won't configure several USB scanners (i.e. ScanSnap 300M) because their + * descriptors are vendor specific. As a result the device will get configured + * later during sanei_usb_open making it safe to ignore the configuration check + * here on these platforms. */ +#if !defined(__APPLE__) if (config == 0) { DBG (1, "sanei_usb_open: device `%s' not configured?\n", devname); return SANE_STATUS_INVAL; } +#endif result = libusb_get_device_descriptor (dev, &desc); if (result < 0)