Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libusb: allow hidapi to be configured without using iconv #447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libusb/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

/* GNU / LibUSB */
#include <libusb.h>
#ifndef __ANDROID__
#if !defined(__ANDROID__) && !defined(NO_ICONV)
#include <iconv.h>
#endif

Expand Down Expand Up @@ -390,7 +390,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 */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if !defined(__ANDROID__) && !defined(NO_ICONV) /* 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;
Expand Down Expand Up @@ -420,7 +420,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
Expand Down