0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-05-10 02:15:29 +00:00
Files
termux-packages/packages/hidapi/termux-iconv-hid.c.patch
Henrik Grimler 7c9d62d84d addpkg(main/hidapi): 0.14.0
hidapi can be used with libusb, or the kernel driver "hidraw" (likely
only relevant for rooted devices), to access HID devices. Goal is to
patch it further and use it together with termux-usb.

Add it now for testing and development purposes.
2025-02-07 20:18:23 +01:00

30 lines
1.1 KiB
Diff

--- ./libusb/hid.c~ 2023-05-22 10:50:06.000000000 +0000
+++ ./libusb/hid.c 2025-02-01 13:13:05.412357928 +0000
@@ -42,7 +42,7 @@
/* GNU / LibUSB */
#include <libusb.h>
-#if !defined(__ANDROID__) && !defined(NO_ICONV)
+#if (!defined(__ANDROID__) || defined(__TERMUX__)) && !defined(NO_ICONV)
#include <iconv.h>
#ifndef ICONV_CONST
#define ICONV_CONST
@@ -406,7 +406,7 @@
int len;
wchar_t *str = NULL;
-#if !defined(__ANDROID__) && !defined(NO_ICONV) /* we don't use iconv on Android, or when it is explicitly disabled */
+#if (!defined(__ANDROID__) || defined(__TERMUX__)) && !defined(NO_ICONV) /* we don't use iconv on non-Termux Android, or when it is explicitly disabled */
wchar_t wbuf[256];
/* iconv variables */
iconv_t ic;
@@ -432,7 +432,7 @@
if (len < 2) /* we always skip first 2 bytes */
return NULL;
-#if defined(__ANDROID__) || defined(NO_ICONV)
+#if (defined(__ANDROID__) || defined(NO_ICONV)) && !defined(__TERMUX__)
/* Bionic does not have iconv support nor wcsdup() function, so it
has to be done manually. The following code will only work for