mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
Use recently added OS version detection to check for HID Manager API availability
This commit is contained in:
parent
e9b24a10a1
commit
b4ff34dae5
1 changed files with 3 additions and 11 deletions
|
@ -37,13 +37,12 @@
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||||
|
|
||||||
#include <CoreServices/CoreServices.h>
|
|
||||||
|
|
||||||
#include "HID_Utilities_External.h"
|
#include "HID_Utilities_External.h"
|
||||||
|
|
||||||
#include "d_event.h"
|
#include "d_event.h"
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
#include "templates.h"
|
#include "templates.h"
|
||||||
|
#include "i_osversion.h"
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
@ -730,16 +729,9 @@ IOKitJoystickManager* s_joystickManager;
|
||||||
|
|
||||||
void I_StartupJoysticks()
|
void I_StartupJoysticks()
|
||||||
{
|
{
|
||||||
SInt32 majorVersion = 0;
|
// HID Manager API is available on 10.5 (Darwin 9.x) or newer
|
||||||
SInt32 minorVersion = 0;
|
|
||||||
|
|
||||||
#pragma clang diagnostic push
|
if (darwinVersion.major >= 9)
|
||||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
Gestalt(gestaltSystemVersionMajor, &majorVersion);
|
|
||||||
Gestalt(gestaltSystemVersionMinor, &minorVersion);
|
|
||||||
#pragma clang diagnostic pop
|
|
||||||
|
|
||||||
if (majorVersion >= 10 && minorVersion >= 5)
|
|
||||||
{
|
{
|
||||||
s_joystickManager = new IOKitJoystickManager;
|
s_joystickManager = new IOKitJoystickManager;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue