libusb: allow hidapi to be configured without using iconv

This commit is contained in:
wet34t
2019-11-19 11:13:03 -05:00
committed by Ihor Dutchak
parent 2dd94af2ea
commit 533dd9229a

View File

@@ -45,7 +45,7 @@
/* GNU / LibUSB */
#include <libusb.h>
#ifndef __ANDROID__
#if !defined(__ANDROID__) && !defined(NO_ICONV)
#include <iconv.h>
#endif
@@ -395,7 +395,7 @@ static wchar_t *get_usb_string(libusb_device_handle *dev, uint8_t idx)
int len;
wchar_t *str = NULL;
#ifndef __ANDROID__ /* we don't use iconv on Android */
#if !defined(__ANDROID__) && !defined(NO_ICONV) /* we don't use iconv on Android, or when it is explicitly disabled */
wchar_t wbuf[256];
/* iconv variables */
iconv_t ic;
@@ -421,7 +421,7 @@ static wchar_t *get_usb_string(libusb_device_handle *dev, uint8_t idx)
if (len < 0)
return NULL;
#ifdef __ANDROID__
#if defined(__ANDROID__) || defined(NO_ICONV)
/* Bionic does not have iconv support nor wcsdup() function, so it
has to be done manually. The following code will only work for