mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 22:48:55 +02:00
51 lines
1.2 KiB
Plaintext
51 lines
1.2 KiB
Plaintext
From ed4c9a8b17ced9f1668084539509d7866438fdc4 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Mon, 16 Nov 2015 11:13:48 +0000
|
|
Subject: Disable libusb context for Haiku
|
|
|
|
|
|
diff --git a/sanei/sanei_usb.c b/sanei/sanei_usb.c
|
|
index 9c07d22..e4f8b1d 100644
|
|
--- a/sanei/sanei_usb.c
|
|
+++ b/sanei/sanei_usb.c
|
|
@@ -498,7 +498,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,
|
|
@@ -556,7 +561,11 @@ int i;
|
|
#ifdef HAVE_LIBUSB_1_0
|
|
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;
|
|
}
|
|
@@ -880,7 +889,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,
|
|
--
|
|
2.2.2
|
|
|