Fix wxOSX build with < 10.9 SDK after r77511.
We need to guard the use of 10.9+ symbols such as NSActivityOptions at compile-time too and not only at run-time. See #16413, closes #16529. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -36,6 +36,7 @@ bool UpdatePowerResourceUsage(wxPowerResourceKind kind, const wxString& reason)
|
|||||||
if( reason.IsEmpty())
|
if( reason.IsEmpty())
|
||||||
cfreason = wxString("User Activity");
|
cfreason = wxString("User Activity");
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
|
||||||
if ( UMAGetSystemVersion() >= 0x1090 )
|
if ( UMAGetSystemVersion() >= 0x1090 )
|
||||||
{
|
{
|
||||||
// Use NSProcessInfo for 10.9 and newer
|
// Use NSProcessInfo for 10.9 and newer
|
||||||
@@ -55,7 +56,9 @@ bool UpdatePowerResourceUsage(wxPowerResourceKind kind, const wxString& reason)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( !g_pmAssertionID )
|
else
|
||||||
|
#endif
|
||||||
|
if ( !g_pmAssertionID )
|
||||||
{
|
{
|
||||||
// Use power manager API for < 10.9 systems
|
// Use power manager API for < 10.9 systems
|
||||||
IOReturn success = IOPMAssertionCreateWithName
|
IOReturn success = IOPMAssertionCreateWithName
|
||||||
@@ -72,6 +75,7 @@ bool UpdatePowerResourceUsage(wxPowerResourceKind kind, const wxString& reason)
|
|||||||
else if ( g_powerResourceSystemRefCount == 0 )
|
else if ( g_powerResourceSystemRefCount == 0 )
|
||||||
{
|
{
|
||||||
// Release power assertion
|
// Release power assertion
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
|
||||||
if ( UMAGetSystemVersion() >= 0x1090 )
|
if ( UMAGetSystemVersion() >= 0x1090 )
|
||||||
{
|
{
|
||||||
// Use NSProcessInfo for 10.9 and newer
|
// Use NSProcessInfo for 10.9 and newer
|
||||||
@@ -84,7 +88,9 @@ bool UpdatePowerResourceUsage(wxPowerResourceKind kind, const wxString& reason)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( g_pmAssertionID )
|
else
|
||||||
|
#endif
|
||||||
|
if ( g_pmAssertionID )
|
||||||
{
|
{
|
||||||
// Use power manager API for < 10.9 systems
|
// Use power manager API for < 10.9 systems
|
||||||
IOReturn success = IOPMAssertionRelease(g_pmAssertionID);
|
IOReturn success = IOPMAssertionRelease(g_pmAssertionID);
|
||||||
|
Reference in New Issue
Block a user