Giter Site home page Giter Site logo

usb's Introduction

Travis AppVeyor GoDoc

Yet another USB library for Go

The usb package is a cross platform, fully self-contained library for accessing and communicating with USB devices either via HID or low level interrupts. The goal of the library was to create a simple way to find-, attach to- and read/write form USB devices.

There are multiple already existing USB libraries:

  • The original gousb package created by @kylelemons and nowadays maintained by @google is a CGO wrapper around libusb. It is the most advanced USB library for Go out there.
    • Unfortunately, gousb requires the libusb C library to be installed both during build as well as during runtime on the host operating system. This breaks binary portability and also adds unnecessary hurdles on Windows.
    • Furthermore, whilst HID devices are supported by libusb, the OS on Macos and Windows explicitly takes over these devices, so only native system calls can be used on recent versions (i.e. you cannot use libusb for HID).
  • There is a fork of gousb created by @karalabe that statically linked libusb during build, but with the lack of HID access, that work was abandoned.
  • For HID-only devices, a previous self-contained package was created at github.com/karalabe/hid, which worked well for hardware wallet uses cases in go-ethereum. It's a simple package that does its thing well.
    • Unfortunately, hid is not capable of talking to generic USB devices. When multiple different devices are needed, eventually some will not support the HID spec (e.g. WebUSB). Pulling in both hid and gousb will break down due to both depending internally on different versions of libusb on Linux.

This usb package is a proper integration of hidapi and libusb so that communication with HID devices is done via system calls, whereas communication with lower level USB devices is done via interrupts. All this detail is hidden away behind a tiny interface.

The package supports Linux, macOS, Windows and FreeBSD. Exclude constraints are also specified for Android and iOS to allow smoother vendoring into cross platform projects.

Cross-compiling

Using go get, the embedded C library is compiled into the binary format of your host OS. Cross compiling to a different platform or architecture entails disabling CGO by default in Go, causing device enumeration hid.Enumerate() to yield no results.

To cross compile a functional version of this library, you'll need to enable CGO during cross compilation via CGO_ENABLED=1 and you'll need to install and set a cross compilation enabled C toolkit via CC=your-cross-gcc.

Acknowledgements

Although the usb package is an implementation from scratch, HID support was heavily inspired by the existing go.hid library, which seems abandoned since 2015; is incompatible with Go 1.6+; and has various external dependencies.

Wide character support in the HID support is done via the gowchar library, unmaintained since 2013; non buildable with a modern Go release and failing go vet checks. As such, gowchar was also vendored in inline.

Error handling for the libusb integration originates from the gousb library.

License

This USB library is licensed under the GNU Lesser General Public License v3.0 (dictated by libusb).

If you are only interested in Human Interface devices, a less restrictive package can be found at github.com/karalabe/hid.

usb's People

Contributors

bradfitz avatar dindinw avatar fornwall avatar gballet avatar holiman avatar jyap808 avatar karalabe avatar samuelmarks avatar steveruckdashel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

usb's Issues

Printer Error:failed to get device 3 config 0: libusb: not found [code -5]

I am sorry that I got this error when I used this lib to do USB printer job in my Windows10.

below is my code, and error occurred in usb.Enumerate(0, 0) to get all devices.

func findPrinters() ([]Device, error) {
	logrus.Infof("is this os supported: %v", usb.Supported())
	deviceInfos, err := usb.Enumerate(0, 0)
	if err != nil {
		return nil, err
	}
	printers := []Device{}
	for _, info := range deviceInfos {
		dev := WindowsDevice{
			deviceInfo: info,
		}
		printers = append(printers, &dev)
		logrus.Infof("find usb driver vid :%v, pid: %v", dev.GetVid(), dev.GetPid())
	}
	return printers, nil
}

I am not sure what it is meaning about 'libusb'. how should I install it?

Thanks.

Interfacing a USB HID blood pressure monitor to a Raspberry Pi 3

Hello Péter,

First of all, congratulations for this awesome library.

I would like to use your USB HID library to read data from a USB HID capable blood pressure monitor. This is just for a "proof of concept" project, it is not for a commercial product. The communication between the USB HID device and the host can be tracked with Wireshark and USBPcap, and as far as I can see, it is pretty straightforward.

Which of your libraries would you suggest using? Package karalabe/usb or karalabe/hid?

By the way, would it be possible to get examples on how to use the libraries?

Thanks for your help!

windows: karalabe/hid works fine, karalabe/usb gives "hidapi: failed to open device"

I pick a device from hid.Enumerate(0, 0), and call deviceInfo.Open().

This works fine with the hid package on Linux and Windows.

Just dropping in this package and using usb.EnumerateHid(0, 0) followed by deviceInfo.Open() instead works fine on Linux, but on Windows, I get the hidapi: failed to open device error.

By comparing hid.c from both repos, the only difference is this line:

https://github.com/karalabe/hid/blob/9c14560f9ee858c43f40b5cd01392b167aacf4e8/hidapi/windows/hid.c#L431

strncpy(cur_dev->path, str, sizeof(cur_dev->path));

				cur_dev->path = (char*) calloc(len+1, sizeof(char));
				strncpy(cur_dev->path, str, sizeof(cur_dev->path));

Taking sizeof() here is not correct of course, since cur_dev->path is a pointer, not a fixed size buffer.

As a result, with this package, the device path ends up being a broken/truncated "\\?\hid#, while with the hid package, the device path is a normal longer string (same prefix).

Regression introduced in 09268c6

get_usb_string undefined reference to `libiconv_open'

mac ok

macOS Big Sur 11.4
MacBook Pro (16-inch, 2019)

> go version
go version go1.15.2 darwin/amd64

liunx error

> uname -a
Linux xxx 4.18.0-147.43.1.el8_1.x86_64 #1 SMP Thu Feb 18 08:33:46 EST 2021 x86_64 x86_64 x86_64 GNU/Linux

> cat /etc/redhat-release
Red Hat Enterprise Linux release 8.1 (Ootpa)

> go version
go version go1.15.13 linux/amd64

> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)

go run or go build error:

# github.com/karalabe/usb
/tmp/go-build517113935/b245/_x003.o: In function `get_usb_string':
../../pkg/mod/github.com/karalabe/[email protected]/hidapi/libusb/hid.c:440: undefined reference to `libiconv_open'
../../pkg/mod/github.com/karalabe/[email protected]/hidapi/libusb/hid.c:452: undefined reference to `libiconv'
../../pkg/mod/github.com/karalabe/[email protected]/hidapi/libusb/hid.c:467: undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status

OSX 14 - ATOMIC_VAR_INIT deprecation warning

Starting with OSX 14 using xcode 14.0, the ATOMIC_VAR_INT macro definition has been marked deprecated and compilation always prints the warning below:

In file included from .../go/pkg/mod/github.com/karalabe/[email protected]/libs.go:50:
.../go/pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.c:53:29: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/include/stdatomic.h:51:41: note: macro marked 'deprecated' here

build error from mac osx 10.15 fatal error: 'IOKit/IOTypes.h' file not found

hi, when I build a project which depends on notify in mac osx 10.15 , it gets below error

the detail step is described here: would you please to check: ethereum/go-ethereum#21835

error info

# github.com/karalabe/usb
In file included from ../../pkg/mod/github.com/karalabe/[email protected]/libs.go:50:
In file included from ../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.c:72:
../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.h:25:10: fatal error: 'IOKit/IOTypes.h' file not found
#include <IOKit/IOTypes.h>
         ^~~~~~~~~~~~~~~~~
../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.h:25:10: note: did not find header 'IOTypes.h' in framework 'IOKit' (loaded from '/System/Library/Frameworks')
1 error generated.

Redefinition of timespec

windows 10

# github.com/karalabe/usb
In file included from ..\..\..\..\go\pkg\mod\github.com\karalabe\[email protected]\libusb\libusb/libusbi.h:284,
                 from ..\..\..\..\go\pkg\mod\github.com\karalabe\[email protected]\libusb\libusb/os/poll_windows.c:43,
                 from ..\..\..\..\go\pkg\mod\github.com\karalabe\[email protected]\libs.go:41:
..\..\..\..\go\pkg\mod\github.com\karalabe\[email protected]\libusb\libusb/os/threads_windows.h:63:8: error: redefinition of 'struct timespec'
   63 | struct timespec {
      |        ^~~~~~~~
In file included from /usr/include/sys/timespec.h:38,
                 from /usr/include/sys/select.h:16,
                 from /usr/include/sys/types.h:50,
                 from /usr/include/time.h:28,
                 from ..\..\..\..\go\pkg\mod\github.com\karalabe\[email protected]\libusb\libusb/libusbi.h:30,
                 from ..\..\..\..\go\pkg\mod\github.com\karalabe\[email protected]\libusb\libusb/os/poll_windows.c:43,
                 from ..\..\..\..\go\pkg\mod\github.com\karalabe\[email protected]\libs.go:41:
/usr/include/sys/_timespec.h:47:8: note: originally defined here
   47 | struct timespec {
      |        ^~~~~~~~

Android is not supported

OS:

Linux localhost 4.4.103 #54 SMP PREEMPT Mon Nov 4 15:59:50 CST 2019 aarch64

Exec:

b:=usb.Supported()

return false

Deprecation warnings when building on macOS 12.0

Running make geth

Relevant lines

# github.com/karalabe/usb
In file included from ../../../../pkg/mod/github.com/karalabe/[email protected]/libs.go:50:
../../../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.c:253:39: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
In file included from ../../../../pkg/mod/github.com/karalabe/[email protected]/libs.go:50:
../../../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.c:390:26: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
In file included from ../../../../pkg/mod/github.com/karalabe/[email protected]/libs.go:50:
../../../../pkg/mod/github.com/karalabe/[email protected]/libusb/libusb/os/darwin_usb.c:441:60: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
In file included from ../../../../pkg/mod/github.com/karalabe/[email protected]/libs.go:51:
../../../../pkg/mod/github.com/karalabe/[email protected]/hidapi/mac/hid.c:693:34: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:123:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here

Problem compiling karalabe/usb/hid_enabled

github.com/karalabe/usb/hid_enabled.go:22:10:

fatal error: './hidapi/hidapi/hidapi.h' file not found
#include "./hidapi/hidapi/hidapi.h"

With the last commit, it seems a dependency has been broken.

It occurs trying to deploy a GETH client

Can't open device on macos 14 (sonoma)

Hi,

I'm using this lib indirectly from go-ethereum to interface with a Ledger X device and recently I bumped into this error:

hidapi: failed to open device

This started happening in my Mac with macos 14 (sonoma). Debugging it I noticed the usb.DeviceInfo path got an empty string, which then failed when Open is called.

I tried few things such as:

  • Restart host computer
  • Restart device
  • Change cables
  • Run with sudo
  • Allow full disk access to the binary
  • Install libhid and libusd from scratch (not sure if related)

Nothing worked.

I'm consuming the following versions (copied from go.mod):

	github.com/ethereum/go-ethereum v1.13.4

	github.com/karalabe/usb v0.0.3-0.20230918135828-88ad9302fa2c // indirect

Consuming repo: https://github.com/base-org/eip712sign

Thanks for looking into it!

Please let me know if there is anything I can help with.

Bug: the report ID is only prepended on Windows. It should be prepended for macOS/linux as well.

Hi

Here, the report ID is prepended, but only for Windows:

usb/hid_enabled.go

Lines 126 to 128 in 87927bb

if runtime.GOOS == "windows" {
report = append([]byte{0x00}, b...)
} else {

The same issue exists in the hid repo, where I commented about the same issue in 2018: karalabe/hid#7 (comment)

Since the first byte after the report ID can legitimately be a zero byte (a USB packet that starts with a zero byte), this code is broken on linux/macOS, where one has to manually prepend that zero byte report ID. Without prepending the zero byte report ID for linux/macOS, the lower level library will strip the the first byte if it is zero (see below), corrupting the packet:

usb/hidapi/libusb/hid.c

Lines 1003 to 1007 in 87927bb

if (report_number == 0x0) {
data++;
length--;
skipped_report_id = 1;
}

This is a hard issue to find, as it can be a rare event that a packet starts with a zero byte (after the report ID).

See e.g. this PR which implements this workaround: https://github.com/digitalbitbox/bitbox02-api-go/pull/73/files

Demo does not run on windows

When trying to run the demo on windows 10 (1803) via go run demo.go, I get the following error:
panic: failed to get device 0 config 0: libusb: not found [code -5]

The same error appears over and over when trying to run the tests

>go test
--- FAIL: TestThreadedEnumerateRaw (93.06s)
    usb_test.go:58: thread 0, iter 0: failed to enumerate: failed to get device 0 config 0: libusb: not found [code -5]
    usb_test.go:58: thread 0, iter 1: failed to enumerate: failed to get device 0 config 0: libusb: not found [code -5]
    usb_test.go:58: thread 0, iter 2: failed to enumerate: failed to get device 0 config 0: libusb: not found [code -5]

This is with the current version from master and go1.13.1 windows/amd64 (also tried 1.12 with the same result) and mingw (64bit version) as c compiler.
On linux (Ubuntu 18.04) everything works as expected.

Suggestions on what to try or report would be highly appreciated.

GETH 1.9 cross compile for windows error

I am having a hard time to compile geth 1.9.0 for windows, this is the error... any ideas ?
same error happens on linux/osx with go11 or go12.

➜  go-ethereum git:(52f246177) make geth-windows
# github.com/ethereum/go-ethereum/vendor/github.com/karalabe/usb
In file included from /usr/share/mingw-w64/include/objbase.h:14:0,
                 from /usr/share/mingw-w64/include/ole2.h:17,
                 from /usr/share/mingw-w64/include/wtypes.h:12,
                 from /usr/share/mingw-w64/include/winscard.h:10,
                 from /usr/share/mingw-w64/include/windows.h:97,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusb.h:76,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusbi.h:39,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/poll_windows.c:43,
                 from ../../vendor/github.com/karalabe/usb/libs.go:41:
/usr/share/mingw-w64/include/oledlg.h:428:3: error: unknown type name 'interface'
   DECLARE_INTERFACE_(IOleUILinkContainerW,IUnknown) {
   ^
/usr/share/mingw-w64/include/oledlg.h:428:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   DECLARE_INTERFACE_(IOleUILinkContainerW,IUnknown) {
   ^
In file included from /usr/share/mingw-w64/include/setupapi.h:27:0,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/windows_winusb.c:29,
                 from ../../vendor/github.com/karalabe/usb/libs.go:55:
/usr/share/mingw-w64/include/oledlg.h:429:31: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD(QueryInterface)(THIS_ REFIID riid,LPVOID *ppvObj) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:430:30: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:431:31: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD_(ULONG,Release)(THIS) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:432:35: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD_(DWORD,GetNextLink)(THIS_ DWORD dwLink) PURE;
                                   ^
/usr/share/mingw-w64/include/oledlg.h:433:37: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD(SetLinkUpdateOptions)(THIS_ DWORD dwLink,DWORD dwUpdateOpt) PURE;
                                     ^
/usr/share/mingw-w64/include/oledlg.h:434:37: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD(GetLinkUpdateOptions)(THIS_ DWORD dwLink,DWORD *lpdwUpdateOpt) PURE;
                                     ^
/usr/share/mingw-w64/include/oledlg.h:435:30: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD(SetLinkSource)(THIS_ DWORD dwLink,LPWSTR lpszDisplayName,ULONG lenFileName,ULONG *pchEaten,WINBOOL fValidateSource) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:436:30: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD(GetLinkSource)(THIS_ DWORD dwLink,LPWSTR *lplpszDisplayName,ULONG *lplenFileName,LPWSTR *lplpszFullLinkType,LPWSTR *lplpszShortLinkType,WINBOOL *lpfSourceAvailable,WINBOOL *lpfIsSelected) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:437:31: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD(OpenLinkSource)(THIS_ DWORD dwLink) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:438:27: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD(UpdateLink)(THIS_ DWORD dwLink,WINBOOL fErrorMessage,WINBOOL fReserved) PURE;
                           ^
/usr/share/mingw-w64/include/oledlg.h:439:27: error: expected declaration specifiers or '...' before 'IOleUILinkContainerW'
     STDMETHOD(CancelLink)(THIS_ DWORD dwLink) PURE;
                           ^
/usr/share/mingw-w64/include/oledlg.h:442:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
   typedef IOleUILinkContainerW *LPOLEUILINKCONTAINERW;
                                ^
In file included from /usr/share/mingw-w64/include/objbase.h:14:0,
                 from /usr/share/mingw-w64/include/ole2.h:17,
                 from /usr/share/mingw-w64/include/wtypes.h:12,
                 from /usr/share/mingw-w64/include/winscard.h:10,
                 from /usr/share/mingw-w64/include/windows.h:97,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusb.h:76,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusbi.h:39,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/poll_windows.c:43,
                 from ../../vendor/github.com/karalabe/usb/libs.go:41:
/usr/share/mingw-w64/include/oledlg.h:447:3: error: unknown type name 'interface'
   DECLARE_INTERFACE_(IOleUILinkContainerA,IUnknown) {
   ^
/usr/share/mingw-w64/include/oledlg.h:447:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   DECLARE_INTERFACE_(IOleUILinkContainerA,IUnknown) {
   ^
In file included from /usr/share/mingw-w64/include/setupapi.h:27:0,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/windows_winusb.c:29,
                 from ../../vendor/github.com/karalabe/usb/libs.go:55:
/usr/share/mingw-w64/include/oledlg.h:448:31: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD(QueryInterface)(THIS_ REFIID riid,LPVOID *ppvObj) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:449:30: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:450:31: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD_(ULONG,Release)(THIS) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:451:35: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD_(DWORD,GetNextLink)(THIS_ DWORD dwLink) PURE;
                                   ^
/usr/share/mingw-w64/include/oledlg.h:452:37: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD(SetLinkUpdateOptions)(THIS_ DWORD dwLink,DWORD dwUpdateOpt) PURE;
                                     ^
/usr/share/mingw-w64/include/oledlg.h:453:37: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD(GetLinkUpdateOptions)(THIS_ DWORD dwLink,DWORD *lpdwUpdateOpt) PURE;
                                     ^
/usr/share/mingw-w64/include/oledlg.h:454:30: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD(SetLinkSource)(THIS_ DWORD dwLink,LPSTR lpszDisplayName,ULONG lenFileName,ULONG *pchEaten,WINBOOL fValidateSource) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:455:30: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD(GetLinkSource)(THIS_ DWORD dwLink,LPSTR *lplpszDisplayName,ULONG *lplenFileName,LPSTR *lplpszFullLinkType,LPSTR *lplpszShortLinkType,WINBOOL *lpfSourceAvailable,WINBOOL *lpfIsSelected) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:456:31: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD(OpenLinkSource)(THIS_ DWORD dwLink) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:457:27: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD(UpdateLink)(THIS_ DWORD dwLink,WINBOOL fErrorMessage,WINBOOL fReserved) PURE;
                           ^
/usr/share/mingw-w64/include/oledlg.h:458:27: error: expected declaration specifiers or '...' before 'IOleUILinkContainerA'
     STDMETHOD(CancelLink)(THIS_ DWORD dwLink) PURE;
                           ^
/usr/share/mingw-w64/include/oledlg.h:461:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
   typedef IOleUILinkContainerA *LPOLEUILINKCONTAINERA;
                                ^
/usr/share/mingw-w64/include/oledlg.h:478:5: error: unknown type name 'LPOLEUILINKCONTAINERW'
     LPOLEUILINKCONTAINERW lpOleUILinkContainer;
     ^
/usr/share/mingw-w64/include/oledlg.h:491:5: error: unknown type name 'LPOLEUILINKCONTAINERA'
     LPOLEUILINKCONTAINERA lpOleUILinkContainer;
     ^
/usr/share/mingw-w64/include/oledlg.h:711:5: error: unknown type name 'LPOLEUILINKCONTAINERW'
     LPOLEUILINKCONTAINERW lpOleUILinkContainer;
     ^
/usr/share/mingw-w64/include/oledlg.h:731:5: error: unknown type name 'LPOLEUILINKCONTAINERA'
     LPOLEUILINKCONTAINERA lpOleUILinkContainer;
     ^
In file included from /usr/share/mingw-w64/include/objbase.h:14:0,
                 from /usr/share/mingw-w64/include/ole2.h:17,
                 from /usr/share/mingw-w64/include/wtypes.h:12,
                 from /usr/share/mingw-w64/include/winscard.h:10,
                 from /usr/share/mingw-w64/include/windows.h:97,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusb.h:76,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusbi.h:39,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/poll_windows.c:43,
                 from ../../vendor/github.com/karalabe/usb/libs.go:41:
/usr/share/mingw-w64/include/oledlg.h:767:3: error: unknown type name 'interface'
   DECLARE_INTERFACE_(IOleUIObjInfoW,IUnknown) {
   ^
/usr/share/mingw-w64/include/oledlg.h:767:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   DECLARE_INTERFACE_(IOleUIObjInfoW,IUnknown) {
   ^
In file included from /usr/share/mingw-w64/include/setupapi.h:27:0,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/windows_winusb.c:29,
                 from ../../vendor/github.com/karalabe/usb/libs.go:55:
/usr/share/mingw-w64/include/oledlg.h:768:31: error: expected declaration specifiers or '...' before 'IOleUIObjInfoW'
     STDMETHOD(QueryInterface)(THIS_ REFIID riid,LPVOID *ppvObj) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:769:30: error: expected declaration specifiers or '...' before 'IOleUIObjInfoW'
     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:770:31: error: expected declaration specifiers or '...' before 'IOleUIObjInfoW'
     STDMETHOD_(ULONG,Release)(THIS) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:771:30: error: expected declaration specifiers or '...' before 'IOleUIObjInfoW'
     STDMETHOD(GetObjectInfo)(THIS_ DWORD dwObject,DWORD *lpdwObjSize,LPWSTR *lplpszLabel,LPWSTR *lplpszType,LPWSTR *lplpszShortType,LPWSTR *lplpszLocation) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:772:31: error: expected declaration specifiers or '...' before 'IOleUIObjInfoW'
     STDMETHOD(GetConvertInfo)(THIS_ DWORD dwObject,CLSID *lpClassID,WORD *lpwFormat,CLSID *lpConvertDefaultClassID,LPCLSID *lplpClsidExclude,UINT *lpcClsidExclude) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:773:30: error: expected declaration specifiers or '...' before 'IOleUIObjInfoW'
     STDMETHOD(ConvertObject)(THIS_ DWORD dwObject,REFCLSID clsidNew) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:774:28: error: expected declaration specifiers or '...' before 'IOleUIObjInfoW'
     STDMETHOD(GetViewInfo)(THIS_ DWORD dwObject,HGLOBAL *phMetaPict,DWORD *pdvAspect,int *pnCurrentScale) PURE;
                            ^
/usr/share/mingw-w64/include/oledlg.h:775:28: error: expected declaration specifiers or '...' before 'IOleUIObjInfoW'
     STDMETHOD(SetViewInfo)(THIS_ DWORD dwObject,HGLOBAL hMetaPict,DWORD dvAspect,int nCurrentScale,WINBOOL bRelativeToOrig) PURE;
                            ^
/usr/share/mingw-w64/include/oledlg.h:778:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
   typedef IOleUIObjInfoW *LPOLEUIOBJINFOW;
                          ^
In file included from /usr/share/mingw-w64/include/objbase.h:14:0,
                 from /usr/share/mingw-w64/include/ole2.h:17,
                 from /usr/share/mingw-w64/include/wtypes.h:12,
                 from /usr/share/mingw-w64/include/winscard.h:10,
                 from /usr/share/mingw-w64/include/windows.h:97,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusb.h:76,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusbi.h:39,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/poll_windows.c:43,
                 from ../../vendor/github.com/karalabe/usb/libs.go:41:
/usr/share/mingw-w64/include/oledlg.h:783:3: error: unknown type name 'interface'
   DECLARE_INTERFACE_(IOleUIObjInfoA,IUnknown) {
   ^
/usr/share/mingw-w64/include/oledlg.h:783:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   DECLARE_INTERFACE_(IOleUIObjInfoA,IUnknown) {
   ^
In file included from /usr/share/mingw-w64/include/setupapi.h:27:0,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/windows_winusb.c:29,
                 from ../../vendor/github.com/karalabe/usb/libs.go:55:
/usr/share/mingw-w64/include/oledlg.h:784:31: error: expected declaration specifiers or '...' before 'IOleUIObjInfoA'
     STDMETHOD(QueryInterface)(THIS_ REFIID riid,LPVOID *ppvObj) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:785:30: error: expected declaration specifiers or '...' before 'IOleUIObjInfoA'
     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:786:31: error: expected declaration specifiers or '...' before 'IOleUIObjInfoA'
     STDMETHOD_(ULONG,Release)(THIS) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:787:30: error: expected declaration specifiers or '...' before 'IOleUIObjInfoA'
     STDMETHOD(GetObjectInfo)(THIS_ DWORD dwObject,DWORD *lpdwObjSize,LPSTR *lplpszLabel,LPSTR *lplpszType,LPSTR *lplpszShortType,LPSTR *lplpszLocation) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:788:31: error: expected declaration specifiers or '...' before 'IOleUIObjInfoA'
     STDMETHOD(GetConvertInfo)(THIS_ DWORD dwObject,CLSID *lpClassID,WORD *lpwFormat,CLSID *lpConvertDefaultClassID,LPCLSID *lplpClsidExclude,UINT *lpcClsidExclude) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:789:30: error: expected declaration specifiers or '...' before 'IOleUIObjInfoA'
     STDMETHOD(ConvertObject)(THIS_ DWORD dwObject,REFCLSID clsidNew) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:790:28: error: expected declaration specifiers or '...' before 'IOleUIObjInfoA'
     STDMETHOD(GetViewInfo)(THIS_ DWORD dwObject,HGLOBAL *phMetaPict,DWORD *pdvAspect,int *pnCurrentScale) PURE;
                            ^
/usr/share/mingw-w64/include/oledlg.h:791:28: error: expected declaration specifiers or '...' before 'IOleUIObjInfoA'
     STDMETHOD(SetViewInfo)(THIS_ DWORD dwObject,HGLOBAL hMetaPict,DWORD dvAspect,int nCurrentScale,WINBOOL bRelativeToOrig) PURE;
                            ^
/usr/share/mingw-w64/include/oledlg.h:794:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
   typedef IOleUIObjInfoA *LPOLEUIOBJINFOA;
                          ^
In file included from /usr/share/mingw-w64/include/objbase.h:14:0,
                 from /usr/share/mingw-w64/include/ole2.h:17,
                 from /usr/share/mingw-w64/include/wtypes.h:12,
                 from /usr/share/mingw-w64/include/winscard.h:10,
                 from /usr/share/mingw-w64/include/windows.h:97,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusb.h:76,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusbi.h:39,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/poll_windows.c:43,
                 from ../../vendor/github.com/karalabe/usb/libs.go:41:
/usr/share/mingw-w64/include/oledlg.h:804:3: error: unknown type name 'interface'
   DECLARE_INTERFACE_(IOleUILinkInfoW,IOleUILinkContainerW) {
   ^
/usr/share/mingw-w64/include/oledlg.h:804:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   DECLARE_INTERFACE_(IOleUILinkInfoW,IOleUILinkContainerW) {
   ^
In file included from /usr/share/mingw-w64/include/setupapi.h:27:0,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/windows_winusb.c:29,
                 from ../../vendor/github.com/karalabe/usb/libs.go:55:
/usr/share/mingw-w64/include/oledlg.h:805:31: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD(QueryInterface)(THIS_ REFIID riid,LPVOID *ppvObj) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:806:30: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:807:31: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD_(ULONG,Release)(THIS) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:808:35: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD_(DWORD,GetNextLink)(THIS_ DWORD dwLink) PURE;
                                   ^
/usr/share/mingw-w64/include/oledlg.h:809:37: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD(SetLinkUpdateOptions)(THIS_ DWORD dwLink,DWORD dwUpdateOpt) PURE;
                                     ^
/usr/share/mingw-w64/include/oledlg.h:810:37: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD(GetLinkUpdateOptions)(THIS_ DWORD dwLink,DWORD *lpdwUpdateOpt) PURE;
                                     ^
/usr/share/mingw-w64/include/oledlg.h:811:30: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD(SetLinkSource)(THIS_ DWORD dwLink,LPWSTR lpszDisplayName,ULONG lenFileName,ULONG *pchEaten,WINBOOL fValidateSource) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:812:30: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD(GetLinkSource)(THIS_ DWORD dwLink,LPWSTR *lplpszDisplayName,ULONG *lplenFileName,LPWSTR *lplpszFullLinkType,LPWSTR *lplpszShortLinkType,WINBOOL *lpfSourceAvailable,WINBOOL *lpfIsSelected) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:813:31: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD(OpenLinkSource)(THIS_ DWORD dwLink) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:814:27: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD(UpdateLink)(THIS_ DWORD dwLink,WINBOOL fErrorMessage,WINBOOL fReserved) PURE;
                           ^
/usr/share/mingw-w64/include/oledlg.h:815:27: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD(CancelLink)(THIS_ DWORD dwLink) PURE;
                           ^
/usr/share/mingw-w64/include/oledlg.h:816:30: error: expected declaration specifiers or '...' before 'IOleUILinkInfoW'
     STDMETHOD(GetLastUpdate)(THIS_ DWORD dwLink,FILETIME *lpLastUpdate) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:819:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
   typedef IOleUILinkInfoW *LPOLEUILINKINFOW;
                           ^
In file included from /usr/share/mingw-w64/include/objbase.h:14:0,
                 from /usr/share/mingw-w64/include/ole2.h:17,
                 from /usr/share/mingw-w64/include/wtypes.h:12,
                 from /usr/share/mingw-w64/include/winscard.h:10,
                 from /usr/share/mingw-w64/include/windows.h:97,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusb.h:76,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/libusbi.h:39,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/poll_windows.c:43,
                 from ../../vendor/github.com/karalabe/usb/libs.go:41:
/usr/share/mingw-w64/include/oledlg.h:824:3: error: unknown type name 'interface'
   DECLARE_INTERFACE_(IOleUILinkInfoA,IOleUILinkContainerA) {
   ^
/usr/share/mingw-w64/include/oledlg.h:824:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   DECLARE_INTERFACE_(IOleUILinkInfoA,IOleUILinkContainerA) {
   ^
In file included from /usr/share/mingw-w64/include/setupapi.h:27:0,
                 from ../../vendor/github.com/karalabe/usb/libusb/libusb/os/windows_winusb.c:29,
                 from ../../vendor/github.com/karalabe/usb/libs.go:55:
/usr/share/mingw-w64/include/oledlg.h:825:31: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD(QueryInterface)(THIS_ REFIID riid,LPVOID *ppvObj) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:826:30: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:827:31: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD_(ULONG,Release)(THIS) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:828:35: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD_(DWORD,GetNextLink)(THIS_ DWORD dwLink) PURE;
                                   ^
/usr/share/mingw-w64/include/oledlg.h:829:37: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD(SetLinkUpdateOptions)(THIS_ DWORD dwLink,DWORD dwUpdateOpt) PURE;
                                     ^
/usr/share/mingw-w64/include/oledlg.h:830:37: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD(GetLinkUpdateOptions)(THIS_ DWORD dwLink,DWORD *lpdwUpdateOpt) PURE;
                                     ^
/usr/share/mingw-w64/include/oledlg.h:831:30: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD(SetLinkSource)(THIS_ DWORD dwLink,LPSTR lpszDisplayName,ULONG lenFileName,ULONG *pchEaten,WINBOOL fValidateSource) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:832:30: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD(GetLinkSource)(THIS_ DWORD dwLink,LPSTR *lplpszDisplayName,ULONG *lplenFileName,LPSTR *lplpszFullLinkType,LPSTR *lplpszShortLinkType,WINBOOL *lpfSourceAvailable,WINBOOL *lpfIsSelected) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:833:31: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD(OpenLinkSource)(THIS_ DWORD dwLink) PURE;
                               ^
/usr/share/mingw-w64/include/oledlg.h:834:27: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD(UpdateLink)(THIS_ DWORD dwLink,WINBOOL fErrorMessage,WINBOOL fReserved) PURE;
                           ^
/usr/share/mingw-w64/include/oledlg.h:835:27: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD(CancelLink)(THIS_ DWORD dwLink) PURE;
                           ^
/usr/share/mingw-w64/include/oledlg.h:836:30: error: expected declaration specifiers or '...' before 'IOleUILinkInfoA'
     STDMETHOD(GetLastUpdate)(THIS_ DWORD dwLink,FILETIME *lpLastUpdate) PURE;
                              ^
/usr/share/mingw-w64/include/oledlg.h:839:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
   typedef IOleUILinkInfoA *LPOLEUILINKINFOA;
                           ^
/usr/share/mingw-w64/include/oledlg.h:952:5: error: unknown type name 'LPOLEUIOBJINFOW'
     LPOLEUIOBJINFOW lpObjInfo;
     ^
/usr/share/mingw-w64/include/oledlg.h:954:5: error: unknown type name 'LPOLEUILINKINFOW'
     LPOLEUILINKINFOW lpLinkInfo;
     ^
/usr/share/mingw-w64/include/oledlg.h:965:5: error: unknown type name 'LPOLEUIOBJINFOA'
     LPOLEUIOBJINFOA lpObjInfo;
     ^
/usr/share/mingw-w64/include/oledlg.h:967:5: error: unknown type name 'LPOLEUILINKINFOA'
     LPOLEUILINKINFOA lpLinkInfo;
     ^
/usr/share/mingw-w64/include/oledlg.h:1023:38: error: unknown type name 'LPOLEUILINKCONTAINERW'
   STDAPI_(WINBOOL) OleUIUpdateLinksW(LPOLEUILINKCONTAINERW lpOleUILinkCntr,HWND hwndParent,LPWSTR lpszTitle,int cLinks);
                                      ^
/usr/share/mingw-w64/include/oledlg.h:1024:38: error: unknown type name 'LPOLEUILINKCONTAINERA'
   STDAPI_(WINBOOL) OleUIUpdateLinksA(LPOLEUILINKCONTAINERA lpOleUILinkCntr,HWND hwndParent,LPSTR lpszTitle,int cLinks);
                                      ^

Build warning on FreeBSD

# github.com/karalabe/usb
In file included from /home/fjl/go/pkg/mod/github.com/karalabe/[email protected]/libs.go:59:
/home/fjl/go/pkg/mod/github.com/karalabe/[email protected]/hidapi/libusb/hid.c:456:18: warning: passing 'const char **' to parameter of type 'char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
/usr/include/iconv.h:58:41: note: passing argument to parameter here

Windows build warning

Random droppings from appveyor windows build:

# github.com/ethereum/go-ethereum/vendor/github.com/karalabe/usb
In file included from vendor\github.com\karalabe\usb\libs.go:56:
vendor\github.com\karalabe\usb/hidapi/windows/hid.c: In function 'hid_enumerate':
vendor\github.com\karalabe\usb/hidapi/windows/hid.c:431:5: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
     strncpy(cur_dev->path, str, len+1);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vendor\github.com\karalabe\usb/hidapi/windows/hid.c:429:11: note: length computed here
     len = strlen(str);
           ^~~~~~~~~~~

I'm not sure how to make it happy...

Bug in the recent macOS 12.0 build fix

This commit:

c7c6bc0#diff-030195b530be26a69d54ce9487a942a3b24568c08397d003492f4507e1217f16R33

uses MAC_OS_X_VERSION_MAX_ALLOWED to determine whether to use the old or new name. This definition can be 120000 even if compiling on macOS 11, resulting in compiler warnings and a broken build.

It looks like MAC_OS_X_VERSION_MIN_REQUIRED should be used instead?

Like in this patch:

https://bug-224632-attachments.webkit.org/attachment.cgi?id=426166 (from https://bugs.webkit.org/show_bug.cgi?id=224632).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.