Skip to content
Permalink
Browse files

Make it a bit tidier, on advice from @krytarowski

  • Loading branch information...
tih committed Jun 9, 2018
1 parent 0e01a10 commit 232474e6ad239ba5bb9708e5d5b0c265e814f223
Showing with 7 additions and 5 deletions.
  1. +7 −5 cpp/hidapi/libusb/hid.c
@@ -59,6 +59,12 @@ extern "C" {
#define LOG(...) do {} while (0)
#endif

#ifdef __NetBSD__
#define ICONV_CONST const
#else
#define ICONV_CONST
#endif

#ifndef __FreeBSD__
#define DETACH_KERNEL_DRIVER
#else
@@ -369,11 +375,7 @@ static wchar_t *get_usb_string(libusb_device_handle *dev, uint8_t idx)
inbytes = len-2;
outptr = (char*) wbuf;
outbytes = sizeof(wbuf);
#ifdef __NetBSD__
res = iconv(ic, (const char ** restrict)&inptr, &inbytes, &outptr, &outbytes);
#else
res = iconv(ic, &inptr, &inbytes, &outptr, &outbytes);
#endif
res = iconv(ic, (ICONV_CONST char **)&inptr, &inbytes, &outptr, &outbytes);
if (res == (size_t)-1) {
LOG("iconv() failed\n");
goto err;

0 comments on commit 232474e

Please sign in to comment.
You can’t perform that action at this time.