From e61db96bc5ba7ed32d455f1408b46b8a93f499c6 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 27 Feb 2016 09:36:52 +0100
Subject: Fix Haiku build.


diff --git a/build/Makefile b/build/Makefile
index 9d37914..dcde088 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -16,6 +16,10 @@ ifeq ($(UNAME), Linux)
 CFLAGS += -fPIC
 endif
 
+ifeq ($(UNAME), Haiku)
+LDFLAGS= -g -shared
+endif
+
 ifeq ($(UNAME), Darwin)
 CFLAGS += -arch i386 -mmacosx-version-min=10.5
 LDFLAGS += -arch i386 -dynamiclib -current_version 2.0 -install_name @executable_path/../Frameworks/libusbhxcfe.dylib -mmacosx-version-min=10.5
-- 
2.7.0


From 439fe6a0cc1121e347312ff2212af83037ee95ba Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 27 Feb 2016 10:04:16 +0100
Subject: Haiku hacks.


diff --git a/sources/ftdi.c b/sources/ftdi.c
index 52874cc..6c53666 100644
--- a/sources/ftdi.c
+++ b/sources/ftdi.c
@@ -249,11 +249,13 @@ int createlistenerthread(RDTHREADFUNCTION thread,int priority,ftdi_context ftdih
 
 	//pthread_attr_create(&threadattrib);
 	pthread_attr_init(&threadattrib);
+#ifndef __HAIKU__
 	pthread_attr_setinheritsched(&threadattrib,PTHREAD_EXPLICIT_SCHED);
 	//pthread_attr_setsched(&threadattrib,SCHED_FIFO);
 	//pthread_attr_setprio(&threadattrib,4);
 	
 	pthread_attr_setschedpolicy(&threadattrib,SCHED_FIFO);
+#endif
 	param.sched_priority = sched_get_priority_max(SCHED_FIFO) ;
 	/* set the new scheduling param */
 	pthread_attr_setschedparam (&threadattrib, &param);
-- 
2.7.0

