From 3f217248f401a8486b52f7cdef5fd24ad9ce7d73 Mon Sep 17 00:00:00 2001 From: Ben Olden-Cooligan Date: Thu, 11 Jan 2024 20:20:47 -0800 Subject: [PATCH 1/2] Always use pthreads for macOS https://gitlab.com/sane-project/backends/-/issues/153 --- acinclude.m4 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 71e22c8d4..90af48dd8 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -248,8 +248,16 @@ AC_DEFUN([SANE_CHECK_PTHREAD], AC_DEFINE(PTHREAD_T_IS_INTEGER, 1, [Define if pthread_t is integer.]) else - # Until the sanei_thread implementation is fixed. - use_pthread=no + case "$host_os" in + darwin*) + # Always use pthreads on macOS + use_pthread=yes + ;; + *) + # Until the sanei_thread implementation is fixed. + use_pthread=no + ;; + esac fi if test "$have_pthread" = "yes" ; then From ec3eacfbcb70cce8be7578955a9713bf4abc3f14 Mon Sep 17 00:00:00 2001 From: Ben Olden-Cooligan Date: Thu, 11 Jan 2024 20:21:36 -0800 Subject: [PATCH 2/2] Remove obsolete pixma macOS workaround Without this change, pixma scanning is currently broken (tested with Canon MP495). The stated reason for the workaround (libusb not supporting timeouts for interrupts) hasn't been true since 2010: https://github.com/libusb/libusb/commit/67d9ef7b6877e17f2deec81cd41dc0948f6bed4b --- backend/pixma/pixma_io_sanei.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/backend/pixma/pixma_io_sanei.c b/backend/pixma/pixma_io_sanei.c index ae780b3e7..394523e79 100644 --- a/backend/pixma/pixma_io_sanei.c +++ b/backend/pixma/pixma_io_sanei.c @@ -62,13 +62,6 @@ # define UNUSED(v) #endif -/* MAC OS X does not support timeouts in darwin/libusb interrupt reads - * This is a very basic turnaround for MAC OS X - * Button scan will not work with this wrapper */ -#ifdef __APPLE__ -# define sanei_usb_read_int sanei_usb_read_bulk -#endif - struct pixma_io_t {