Package: cgminer / 4.9.2-1

kfreebsd_usb.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Description: FreeBSD's libusb-1.0 compatible library has a few differences
 compared to the "normal" libusb-1.0 from libusb.org which we have to
 work around. LIBUSB_CLASS_APPLICATION doesn't exist in FreeBSD's libusb, and
 libusb_handle_events_timeout_completed() doesn't exist either.
 The latter is basically libusb_handle_events_timeout() with an extra
 (unused by us) parameter, so the workaround is relatively simple.
 See http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff;h=6bf4273ee8bb6477ba55e0540e370547bd804641
Author: Scott Howard <showard@debian.org>
Index: cgminer/cgminer.c
===================================================================
--- cgminer.orig/cgminer.c	2014-10-26 10:13:45.426409188 -0400
+++ cgminer/cgminer.c	2014-10-26 10:13:45.422409188 -0400
@@ -108,6 +108,12 @@
 #	define USE_FPGA
 #endif
 
+/* Portability fixes for FreeBSD. */
+#if defined(__FreeBSD_kernel__)
+#define libusb_handle_events_timeout_completed(ctx, tv, c) \
+       libusb_handle_events_timeout(ctx, tv)
+#endif
+
 struct strategies strategies[] = {
 	{ "Failover" },
 	{ "Round Robin" },
Index: cgminer/usbutils.c
===================================================================
--- cgminer.orig/usbutils.c	2014-10-26 10:13:45.426409188 -0400
+++ cgminer/usbutils.c	2014-10-26 10:13:45.422409188 -0400
@@ -18,6 +18,10 @@
 #include "miner.h"
 #include "usbutils.h"
 
+#ifndef LIBUSB_CALL
+#define LIBUSB_CALL
+#endif
+
 static pthread_mutex_t cgusb_lock;
 static pthread_mutex_t cgusbres_lock;
 static cglock_t cgusb_fd_lock;