termux-packages/packages/btfs2/karalabe-usb-pthread_barrie...

25 lines
849 B
Diff

From e188e2d7eefa1a057a20921236f22a6008b29c93 Mon Sep 17 00:00:00 2001
From: Fredrik Fornwall <fredrik@fornwall.net>
Date: Thu, 12 Dec 2019 01:07:20 +0100
Subject: [PATCH] Fix build when targetting Android 7 or later
Support for pthread_barrier was introduced in Android 7, so trying to
build a custom implementation of that clashes with the system headers.
---
hidapi/libusb/hid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hidapi/libusb/hid.c b/hidapi/libusb/hid.c
index 474dff4..dd6fd8c 100644
--- a/hidapi/libusb/hid.c
+++ b/hidapi/libusb/hid.c
@@ -49,7 +49,7 @@
#include "hidapi.h"
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && __ANDROID_API__ < __ANDROID_API_N__
/* Barrier implementation because Android/Bionic don't have pthread_barrier.
This implementation came from Brent Priddy and was posted on