mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-09 05:27:58 +00:00
MacOS build fixes
This commit is contained in:
@@ -76,7 +76,7 @@ class HIDDeviceIOKit : public IHIDDevice {
|
||||
}
|
||||
|
||||
static void _threadProcUSBLL(std::shared_ptr<HIDDeviceIOKit> device) {
|
||||
pthread_setname_np(fmt::format(fmt("{} Transfer Thread"), device->m_token.getProductName()));
|
||||
pthread_setname_np(fmt::format(fmt("{} Transfer Thread"), device->m_token.getProductName()).c_str());
|
||||
std::unique_lock<std::mutex> lk(device->m_initMutex);
|
||||
|
||||
/* Get the HID element's parent (USB interrupt transfer-interface) */
|
||||
@@ -92,8 +92,8 @@ class HIDDeviceIOKit : public IHIDDevice {
|
||||
}
|
||||
}
|
||||
if (!interfaceEntry) {
|
||||
device->m_devImp->deviceError(fmt::format(fmt("Unable to find interface for {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath).c_str());
|
||||
device->m_devImp->deviceError(fmt("Unable to find interface for {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
lk.unlock();
|
||||
device->m_initCond.notify_one();
|
||||
return;
|
||||
@@ -106,8 +106,8 @@ class HIDDeviceIOKit : public IHIDDevice {
|
||||
err = IOCreatePlugInInterfaceForService(interfaceEntry.get(), kIOUSBInterfaceUserClientTypeID,
|
||||
kIOCFPlugInInterfaceID, &iodev, &score);
|
||||
if (err) {
|
||||
device->m_devImp->deviceError(fmt::format(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath).c_str());
|
||||
device->m_devImp->deviceError(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
lk.unlock();
|
||||
device->m_initCond.notify_one();
|
||||
return;
|
||||
@@ -117,8 +117,8 @@ class HIDDeviceIOKit : public IHIDDevice {
|
||||
IUnknownPointer<IOUSBInterfaceInterface> intf;
|
||||
err = iodev.As(&intf, kIOUSBInterfaceInterfaceID);
|
||||
if (err) {
|
||||
device->m_devImp->deviceError(fmt::format(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath).c_str());
|
||||
device->m_devImp->deviceError(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
lk.unlock();
|
||||
device->m_initCond.notify_one();
|
||||
return;
|
||||
@@ -129,11 +129,11 @@ class HIDDeviceIOKit : public IHIDDevice {
|
||||
err = intf->USBInterfaceOpen(intf.storage());
|
||||
if (err != kIOReturnSuccess) {
|
||||
if (err == kIOReturnExclusiveAccess) {
|
||||
device->m_devImp->deviceError(fmt::format(fmt("Unable to open {}@{}: someone else using it\n"),
|
||||
device->m_token.getProductName(), device->m_devPath).c_str());
|
||||
device->m_devImp->deviceError(fmt("Unable to open {}@{}: someone else using it\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
} else {
|
||||
device->m_devImp->deviceError(fmt::format(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath).c_str());
|
||||
device->m_devImp->deviceError(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
}
|
||||
lk.unlock();
|
||||
device->m_initCond.notify_one();
|
||||
@@ -196,15 +196,15 @@ class HIDDeviceIOKit : public IHIDDevice {
|
||||
}
|
||||
|
||||
static void _threadProcHID(std::shared_ptr<HIDDeviceIOKit> device) {
|
||||
pthread_setname_np(fmt::format(fmt("{} Transfer Thread"), device->m_token.getProductName());
|
||||
pthread_setname_np(fmt::format(fmt("{} Transfer Thread"), device->m_token.getProductName()).c_str());
|
||||
std::unique_lock<std::mutex> lk(device->m_initMutex);
|
||||
|
||||
/* Get the HID element's object (HID device interface) */
|
||||
IOObjectPointer<io_service_t> interfaceEntry =
|
||||
IORegistryEntryFromPath(kIOMasterPortDefault, device->m_devPath.data());
|
||||
if (!IOObjectConformsTo(interfaceEntry.get(), "IOHIDDevice")) {
|
||||
device->m_devImp->deviceError(fmt::format(fmt("Unable to find interface for {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
device->m_devImp->deviceError(fmt("Unable to find interface for {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
lk.unlock();
|
||||
device->m_initCond.notify_one();
|
||||
return;
|
||||
@@ -212,8 +212,8 @@ class HIDDeviceIOKit : public IHIDDevice {
|
||||
|
||||
device->m_hidIntf = IOHIDDeviceCreate(nullptr, interfaceEntry.get());
|
||||
if (!device->m_hidIntf) {
|
||||
device->m_devImp->deviceError(fmt::format(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath).c_str());
|
||||
device->m_devImp->deviceError(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
lk.unlock();
|
||||
device->m_initCond.notify_one();
|
||||
return;
|
||||
@@ -223,11 +223,11 @@ class HIDDeviceIOKit : public IHIDDevice {
|
||||
IOReturn err = IOHIDDeviceOpen(device->m_hidIntf.get(), kIOHIDOptionsTypeNone);
|
||||
if (err != kIOReturnSuccess) {
|
||||
if (err == kIOReturnExclusiveAccess) {
|
||||
device->m_devImp->deviceError(fmt::format(fmt("Unable to open {}@{}: someone else using it\n"),
|
||||
device->m_token.getProductName(), device->m_devPath).c_str());
|
||||
device->m_devImp->deviceError(fmt("Unable to open {}@{}: someone else using it\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
} else {
|
||||
device->m_devImp->deviceError(fmt::format(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath).c_str());
|
||||
device->m_devImp->deviceError(fmt("Unable to open {}@{}\n"),
|
||||
device->m_token.getProductName(), device->m_devPath);
|
||||
}
|
||||
lk.unlock();
|
||||
device->m_initCond.notify_one();
|
||||
|
||||
Reference in New Issue
Block a user