mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
USB: Work around a gcc bug that affects lambdas
https://stackoverflow.com/questions/32097759
This commit is contained in:
parent
5d82635449
commit
18a947a1bc
@ -37,14 +37,16 @@ IPCCommandResult USB_HIDv5::IOCtl(const IOCtlRequest& request)
|
||||
case USB::IOCTL_USBV5_SHUTDOWN:
|
||||
return Shutdown(request);
|
||||
case USB::IOCTL_USBV5_GETDEVPARAMS:
|
||||
return HandleDeviceIOCtl(request, [&](auto& device) { return GetDeviceInfo(device, request); });
|
||||
return HandleDeviceIOCtl(request,
|
||||
[&](USBV5Device& device) { return GetDeviceInfo(device, request); });
|
||||
case USB::IOCTL_USBV5_ATTACHFINISH:
|
||||
return GetDefaultReply(IPC_SUCCESS);
|
||||
case USB::IOCTL_USBV5_SUSPEND_RESUME:
|
||||
return HandleDeviceIOCtl(request, [&](auto& device) { return SuspendResume(device, request); });
|
||||
return HandleDeviceIOCtl(request,
|
||||
[&](USBV5Device& device) { return SuspendResume(device, request); });
|
||||
case USB::IOCTL_USBV5_CANCELENDPOINT:
|
||||
return HandleDeviceIOCtl(request,
|
||||
[&](auto& device) { return CancelEndpoint(device, request); });
|
||||
[&](USBV5Device& device) { return CancelEndpoint(device, request); });
|
||||
default:
|
||||
request.DumpUnknown(GetDeviceName(), LogTypes::IOS_USB, LogTypes::LERROR);
|
||||
return GetDefaultReply(IPC_SUCCESS);
|
||||
@ -151,10 +153,11 @@ IPCCommandResult USB_HIDv5::GetDeviceInfo(USBV5Device& device, const IOCtlReques
|
||||
Memory::CopyToEmu(request.buffer_out + 56, &config_descriptor, sizeof(config_descriptor));
|
||||
|
||||
std::vector<USB::InterfaceDescriptor> interfaces = host_device->GetInterfaces(0);
|
||||
auto it = std::find_if(interfaces.begin(), interfaces.end(), [&](const auto& interface) {
|
||||
return interface.bInterfaceNumber == device.interface_number &&
|
||||
interface.bAlternateSetting == alt_setting;
|
||||
});
|
||||
auto it = std::find_if(interfaces.begin(), interfaces.end(),
|
||||
[&](const USB::InterfaceDescriptor& interface) {
|
||||
return interface.bInterfaceNumber == device.interface_number &&
|
||||
interface.bAlternateSetting == alt_setting;
|
||||
});
|
||||
if (it == interfaces.end())
|
||||
return GetDefaultReply(IPC_EINVAL);
|
||||
it->Swap();
|
||||
|
@ -45,17 +45,19 @@ IPCCommandResult USB_VEN::IOCtl(const IOCtlRequest& request)
|
||||
case USB::IOCTL_USBV5_SHUTDOWN:
|
||||
return Shutdown(request);
|
||||
case USB::IOCTL_USBV5_GETDEVPARAMS:
|
||||
return HandleDeviceIOCtl(request, [&](auto& device) { return GetDeviceInfo(device, request); });
|
||||
return HandleDeviceIOCtl(request,
|
||||
[&](USBV5Device& device) { return GetDeviceInfo(device, request); });
|
||||
case USB::IOCTL_USBV5_ATTACHFINISH:
|
||||
return GetDefaultReply(IPC_SUCCESS);
|
||||
case USB::IOCTL_USBV5_SETALTERNATE:
|
||||
return HandleDeviceIOCtl(request,
|
||||
[&](auto& device) { return SetAlternateSetting(device, request); });
|
||||
return HandleDeviceIOCtl(
|
||||
request, [&](USBV5Device& device) { return SetAlternateSetting(device, request); });
|
||||
case USB::IOCTL_USBV5_SUSPEND_RESUME:
|
||||
return HandleDeviceIOCtl(request, [&](auto& device) { return SuspendResume(device, request); });
|
||||
return HandleDeviceIOCtl(request,
|
||||
[&](USBV5Device& device) { return SuspendResume(device, request); });
|
||||
case USB::IOCTL_USBV5_CANCELENDPOINT:
|
||||
return HandleDeviceIOCtl(request,
|
||||
[&](auto& device) { return CancelEndpoint(device, request); });
|
||||
[&](USBV5Device& device) { return CancelEndpoint(device, request); });
|
||||
default:
|
||||
request.DumpUnknown(GetDeviceName(), LogTypes::IOS_USB, LogTypes::LERROR);
|
||||
return GetDefaultReply(IPC_SUCCESS);
|
||||
@ -141,10 +143,11 @@ IPCCommandResult USB_VEN::GetDeviceInfo(USBV5Device& device, const IOCtlRequest&
|
||||
Memory::CopyToEmu(request.buffer_out + 40, &config_descriptor, sizeof(config_descriptor));
|
||||
|
||||
std::vector<USB::InterfaceDescriptor> interfaces = host_device->GetInterfaces(0);
|
||||
auto it = std::find_if(interfaces.begin(), interfaces.end(), [&](const auto& interface) {
|
||||
return interface.bInterfaceNumber == device.interface_number &&
|
||||
interface.bAlternateSetting == alt_setting;
|
||||
});
|
||||
auto it = std::find_if(interfaces.begin(), interfaces.end(),
|
||||
[&](const USB::InterfaceDescriptor& interface) {
|
||||
return interface.bInterfaceNumber == device.interface_number &&
|
||||
interface.bAlternateSetting == alt_setting;
|
||||
});
|
||||
if (it == interfaces.end())
|
||||
return GetDefaultReply(IPC_EINVAL);
|
||||
it->Swap();
|
||||
|
Loading…
Reference in New Issue
Block a user