From 2c6e73e47de95dcc8d2a67f814bf2d5d154eae67 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Mon, 7 Jan 2019 23:19:59 +0100
Subject: Build fixes


diff --git a/src/hardware/beaglelogic/beaglelogic.h b/src/hardware/beaglelogic/beaglelogic.h
index 2150032..184f2e9 100644
--- a/src/hardware/beaglelogic/beaglelogic.h
+++ b/src/hardware/beaglelogic/beaglelogic.h
@@ -23,8 +23,10 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 #include <sys/types.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <sys/ioctl.h>
+#include <sys/ioccom.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <unistd.h>
 
-- 
2.30.2


From 1b6fcf7e02620c217a1e3e7ad9b8ad0c44f40490 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 9 Jan 2019 00:15:24 +0100
Subject: Remove broken windows specific thing


diff --git a/configure.ac b/configure.ac
index 9c42cf3..eb1b3d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -582,9 +582,6 @@ AC_CHECK_FUNCS([zip_discard])
 LIBS=$sr_save_libs
 CFLAGS=$sr_save_cflags
 
-AM_COND_IF([NEED_USB], [AS_CASE([$sr_have_libusb_os_handle:$host_os], [no:mingw*],
-	[AC_MSG_ERROR([Windows builds require the event-abstraction branch of libusb])])])
-
 sr_glib_version=`$PKG_CONFIG --modversion glib-2.0 2>&AS_MESSAGE_LOG_FD`
 sr_libzip_version=`$PKG_CONFIG --modversion libzip 2>&AS_MESSAGE_LOG_FD`
 
-- 
2.30.2


From b5b70591fcf14fa55556affc0a85a44082d7d8bf Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Fri, 11 Jan 2019 21:46:00 +0100
Subject: Fix C++ bindings build


diff --git a/Makefile.am b/Makefile.am
index 2e111e9..6bc7e84 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -737,6 +737,7 @@ bindings_cxx_libsigrokcxx_la_SOURCES = bindings/cxx/classes.cpp
 
 bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS) $(SR_EXTRA_CXX_LIBS)
 bindings_cxx_libsigrokcxx_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
+bindings_cxx_libsigrokcxx_la_CXXFLAGS = `pkg-config --cflags glibmm-2.4`
 
 bindings_cxx_libsigrokcxx_la_includedir = $(includedir)/libsigrokcxx
 bindings_cxx_libsigrokcxx_la_include_HEADERS = \
diff --git a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
index e087f85..956a5d0 100644
--- a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
+++ b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
@@ -83,6 +83,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 #include <vector>
 #include <map>
 #include <set>
+#include <functional>
 
 namespace sigrok
 {
-- 
2.30.2


From fff59c81a46636ff40a640b0fba7c15bbc087816 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 12 Jan 2019 14:29:46 +0100
Subject: Use *BSD codepath for enumerating USB devices


diff --git a/src/usb.c b/src/usb.c
index 8a8f0ca..6b36075 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -479,18 +479,18 @@ SR_PRIV int usb_get_port_path(libusb_device *dev, char *path, int path_len)
  * have been opened with libusb_open().
  * This apparently also applies to some Mac OS X versions.
  */
-#if defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__HAIKU__)
 	struct libusb_device_handle *devh;
 	if (libusb_open(dev, &devh) != 0)
 		return SR_ERR;
 #endif
 	n = libusb_get_port_numbers(dev, port_numbers, sizeof(port_numbers));
-#if defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__HAIKU__)
 	libusb_close(devh);
 #endif
 
 /* Workaround FreeBSD / Mac OS X libusb_get_port_numbers() returning 0. */
-#if defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__HAIKU__)
 	if (n == 0) {
 		port_numbers[0] = libusb_get_device_address(dev);
 		n = 1;
-- 
2.30.2

