0
0
Fork 0
haikuports/media-gfx/sane_backends/patches/sane_backends-1.0.32.patchset

186 lines
4.5 KiB
Plaintext

From 42cdfe983ce6d2277bc3afbdc190aeb4b595881e Mon Sep 17 00:00:00 2001
From: Ken Mays <kmays2000@gmail.com>
Date: Sun, 10 May 2020 02:15:08 +0000
Subject: Use USE_PTHREAD on Haiku for SnapScan Backend
diff --git a/backend/snapscan-usb.c b/backend/snapscan-usb.c
index 49cca1a..269fdbc 100644
--- a/backend/snapscan-usb.c
+++ b/backend/snapscan-usb.c
@@ -533,7 +533,7 @@ static void snapscani_usb_shm_exit(void)
}
#else
#include <sys/ipc.h>
-#include <sys/shm.h>
+
static SANE_Status snapscani_usb_shm_init(void)
{
unsigned int shm_size = sizeof(struct urb_counters_t);
--
2.30.0
From 1b9ed880f9c7d22bb7b99de6363c331628e6ad9e Mon Sep 17 00:00:00 2001
From: Ken Mays <kmays2000@gmail.com>
Date: Thu, 5 Sep 2019 01:15:08 +0000
Subject: Fix strsep redefined
diff --git a/include/sane/config.h.in b/include/sane/config.h.in
index 9d7faea..7f95ff7 100644
--- a/include/sane/config.h.in
+++ b/include/sane/config.h.in
@@ -702,11 +702,12 @@ char *strdup (const char * s);
char *strndup(const char * s, size_t n);
#endif
-/* Prototype for strsep */
+/* Prototype for strsep
#ifndef HAVE_STRSEP
#define strsep sanei_strsep
char *strsep(char **stringp, const char *delim);
#endif
+*/
/* Prototype for usleep */
#ifndef HAVE_USLEEP
--
2.30.0
From 9aa3b99faf7f1deaea4474379d7e23388a99aff7 Mon Sep 17 00:00:00 2001
From: Ken Mays <kmays2000@gmail.com>
Date: Thu, 5 Sep 2019 01:15:08 +0000
Subject: Fix fcntl placement
diff --git a/testsuite/sanei/test_wire.c b/testsuite/sanei/test_wire.c
index 48f464a..143a044 100644
--- a/testsuite/sanei/test_wire.c
+++ b/testsuite/sanei/test_wire.c
@@ -4,7 +4,7 @@
#include <string.h>
#include <unistd.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include "../include/sane/sane.h"
#include "../include/sane/sanei.h"
--
2.30.0
From cc163fd192034ef26dafeec1edf70a00f9a9b129 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 13 Nov 2015 11:26:01 +0000
Subject: Fix build for Haiku
diff --git a/backend/epsonds-jpeg.c b/backend/epsonds-jpeg.c
index 244f442..12b4a90 100644
--- a/backend/epsonds-jpeg.c
+++ b/backend/epsonds-jpeg.c
@@ -15,6 +15,10 @@
#include "sane/config.h"
+#ifdef __HAIKU__
+#define _STDLIB_H_
+#endif
+
#include <math.h>
#include "epsonds.h"
@@ -49,8 +53,8 @@ jpeg_term_source(j_decompress_ptr __sane_unused__ cinfo)
METHODDEF(boolean)
jpeg_fill_input_buffer(j_decompress_ptr cinfo)
{
- epsonds_src_mgr *src = (epsonds_src_mgr *)cinfo->src;
int avail, size;
+ epsonds_src_mgr *src = (epsonds_src_mgr *)cinfo->src;
/* read from the scanner or the ring buffer */
diff --git a/sanei/sanei_thread.c b/sanei/sanei_thread.c
index a5dcae1..1d679cd 100644
--- a/sanei/sanei_thread.c
+++ b/sanei/sanei_thread.c
@@ -484,6 +484,7 @@ SANE_Pid
sanei_thread_waitpid( SANE_Pid pid, int *status )
{
#ifdef USE_PTHREAD
+ int rc;
int *ls;
#else
int ls;
@@ -496,7 +497,6 @@ sanei_thread_waitpid( SANE_Pid pid, int *status )
DBG(2, "sanei_thread_waitpid() - %ld\n",
sanei_thread_pid_to_long(pid));
#ifdef USE_PTHREAD
- int rc;
rc = pthread_join( (pthread_t)pid, (void*)&ls );
if( 0 == rc ) {
diff --git a/sanei/sanei_usb.c b/sanei/sanei_usb.c
index 022f6fa..8cf1ce6 100644
--- a/sanei/sanei_usb.c
+++ b/sanei/sanei_usb.c
@@ -1431,7 +1431,12 @@ sanei_usb_init (void)
if (!sanei_usb_ctx)
{
DBG (4, "%s: initializing libusb-1.0\n", __func__);
+#ifdef __HAIKU__
+ ret = libusb_init (NULL);
+ sanei_usb_ctx = -1;
+#else
ret = libusb_init (&sanei_usb_ctx);
+#endif
if (ret < 0)
{
DBG (1,
@@ -1501,7 +1506,11 @@ int i;
#ifdef HAVE_LIBUSB
if (sanei_usb_ctx)
{
+#ifdef __HAIKU__
+ libusb_exit (NULL);
+#else
libusb_exit (sanei_usb_ctx);
+#endif
/* reset libusb-1.0 context */
sanei_usb_ctx=NULL;
}
@@ -1825,7 +1834,11 @@ static void libusb_scan_devices(void)
DBG (4, "%s: Looking for libusb-1.0 devices\n", __func__);
+#ifdef __HAIKU__
+ ndev = libusb_get_device_list (NULL, &devlist);
+#else
ndev = libusb_get_device_list (sanei_usb_ctx, &devlist);
+#endif
if (ndev < 0)
{
DBG (1,
@@ -3104,6 +3117,7 @@ sanei_usb_clear_halt (SANE_Int dn)
if (testing_mode == sanei_usb_testing_mode_replay)
return SANE_STATUS_GOOD;
+#ifndef __HAIKU__
#ifdef HAVE_LIBUSB_LEGACY
int ret;
@@ -3154,6 +3168,7 @@ sanei_usb_clear_halt (SANE_Int dn)
#else /* not HAVE_LIBUSB_LEGACY && not HAVE_LIBUSB */
DBG (1, "sanei_usb_clear_halt: libusb support missing\n");
#endif /* HAVE_LIBUSB_LEGACY || HAVE_LIBUSB */
+#endif
return SANE_STATUS_GOOD;
}
--
2.30.0