mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-24 03:58:28 +00:00
Fixed Mac OS X build
This commit is contained in:
@@ -171,10 +171,11 @@ static LRESULT CALLBACK ControllerWndProc(HWND hwnd, UINT message, WPARAM wParam
|
||||
|
||||
|
||||
#if defined(__MACOSX__)
|
||||
static void CallbackIOServiceFUNC(void *context, io_iterator_t portIterator)
|
||||
static void CallbackIOServiceFunc(void *context, io_iterator_t portIterator)
|
||||
{
|
||||
/* Must drain the iterator, or we won't receive new notifications */
|
||||
while ((io_object_t entry = IOIteratorNext(portIterator)) != NULL) {
|
||||
io_object_t entry;
|
||||
while ((entry = IOIteratorNext(portIterator)) != 0) {
|
||||
IOObjectRelease(entry);
|
||||
*(SDL_bool*)context = SDL_TRUE;
|
||||
}
|
||||
@@ -225,9 +226,10 @@ HIDAPI_InitializeDiscovery()
|
||||
|
||||
/* Note: IOServiceAddMatchingNotification consumes the reference to matchingDict */
|
||||
io_iterator_t portIterator = 0;
|
||||
io_object_t entry;
|
||||
if (IOServiceAddMatchingNotification(SDL_HIDAPI_discovery.m_notificationPort, kIOMatchedNotification, matchingDict, CallbackIOServiceFunc, &SDL_HIDAPI_discovery.m_bHaveDevicesChanged, &portIterator) == 0) {
|
||||
/* Must drain the existing iterator, or we won't receive new notifications */
|
||||
while (io_object_t entry = IOIteratorNext(portIterator)) {
|
||||
while ((entry = IOIteratorNext(portIterator)) != 0) {
|
||||
IOObjectRelease(entry);
|
||||
}
|
||||
} else {
|
||||
@@ -240,9 +242,10 @@ HIDAPI_InitializeDiscovery()
|
||||
|
||||
/* Note: IOServiceAddMatchingNotification consumes the reference to matchingDict */
|
||||
io_iterator_t portIterator = 0;
|
||||
io_object_t entry;
|
||||
if (IOServiceAddMatchingNotification(SDL_HIDAPI_discovery.m_notificationPort, kIOMatchedNotification, matchingDict, CallbackIOServiceFunc, &SDL_HIDAPI_discovery.m_bHaveDevicesChanged, &portIterator) == 0) {
|
||||
/* Must drain the existing iterator, or we won't receive new notifications */
|
||||
while (io_object_t entry = IOIteratorNext(portIterator)) {
|
||||
while ((entry = IOIteratorNext(portIterator)) != 0) {
|
||||
IOObjectRelease(entry);
|
||||
}
|
||||
} else {
|
||||
@@ -803,6 +806,8 @@ HIDAPI_JoystickQuit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
HIDAPI_ShutdownDiscovery();
|
||||
|
||||
while (SDL_HIDAPI_devices) {
|
||||
HIDAPI_DelDevice(SDL_HIDAPI_devices, SDL_FALSE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user