Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4227 from ligfx/clean_objc
Don't force compile everything as Objective-C++ on macOS
- Loading branch information
Showing
13 changed files
with
89 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// Copyright 2016 Dolphin Emulator Project | ||
// Licensed under GPLv2+ | ||
// Refer to the license.txt file included. | ||
|
||
#pragma once | ||
|
||
#include "Core/HW/WiimoteReal/WiimoteReal.h" | ||
|
||
// Work around an Apple bug: for some reason, IOBluetooth.h errors on | ||
// inclusion in Mavericks, but only in Objective-C++ C++11 mode. I filed | ||
// this as <rdar://15312520>; in the meantime... | ||
#import <Foundation/Foundation.h> | ||
#undef NS_ENUM_AVAILABLE | ||
#define NS_ENUM_AVAILABLE(...) | ||
// end hack | ||
#include <IOBluetooth/IOBluetooth.h> | ||
#include <IOKit/hid/IOHIDManager.h> | ||
#include <IOKit/pwr_mgt/IOPMLib.h> | ||
|
||
namespace WiimoteReal | ||
{ | ||
class WiimoteDarwin final : public Wiimote | ||
{ | ||
public: | ||
WiimoteDarwin(IOBluetoothDevice* device); | ||
~WiimoteDarwin() override; | ||
|
||
// These are not protected/private because ConnectBT needs them. | ||
void DisconnectInternal() override; | ||
IOBluetoothDevice* m_btd; | ||
unsigned char* m_input; | ||
int m_inputlen; | ||
|
||
protected: | ||
bool ConnectInternal() override; | ||
bool IsConnected() const override; | ||
void IOWakeup() override; | ||
int IORead(u8* buf) override; | ||
int IOWrite(u8 const* buf, size_t len) override; | ||
void EnablePowerAssertionInternal() override; | ||
void DisablePowerAssertionInternal() override; | ||
|
||
private: | ||
IOBluetoothL2CAPChannel* m_ichan; | ||
IOBluetoothL2CAPChannel* m_cchan; | ||
bool m_connected; | ||
CFRunLoopRef m_wiimote_thread_run_loop; | ||
IOPMAssertionID m_pm_assertion; | ||
}; | ||
|
||
class WiimoteDarwinHid final : public Wiimote | ||
{ | ||
public: | ||
WiimoteDarwinHid(IOHIDDeviceRef device); | ||
~WiimoteDarwinHid() override; | ||
|
||
protected: | ||
bool ConnectInternal() override; | ||
void DisconnectInternal() override; | ||
bool IsConnected() const override; | ||
void IOWakeup() override; | ||
int IORead(u8* buf) override; | ||
int IOWrite(u8 const* buf, size_t len) override; | ||
|
||
private: | ||
static void ReportCallback(void* context, IOReturn result, void* sender, IOHIDReportType type, | ||
u32 reportID, u8* report, CFIndex reportLength); | ||
static void RemoveCallback(void* context, IOReturn result, void* sender); | ||
void QueueBufferReport(int length); | ||
IOHIDDeviceRef m_device; | ||
bool m_connected; | ||
std::atomic<bool> m_interrupted; | ||
Report m_report_buffer; | ||
Common::FifoQueue<Report> m_buffered_reports; | ||
}; | ||
|
||
} // namespace WiimoteReal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,10 +70,6 @@ | |
|
||
#endif | ||
|
||
#ifdef __APPLE__ | ||
#import <AppKit/AppKit.h> | ||
#endif | ||
|
||
class wxFrame; | ||
|
||
// ------------ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters