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:
Vadim Zeitlin
2014-09-05 12:42:22 +00:00
parent 1c0c0adaea
commit 6fa258860e

View File

@@ -36,6 +36,7 @@ bool UpdatePowerResourceUsage(wxPowerResourceKind kind, const wxString& reason)
if( reason.IsEmpty())
cfreason = wxString("User Activity");
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
if ( UMAGetSystemVersion() >= 0x1090 )
{
// Use NSProcessInfo for 10.9 and newer
@@ -55,7 +56,9 @@ bool UpdatePowerResourceUsage(wxPowerResourceKind kind, const wxString& reason)
return true;
}
}
else if ( !g_pmAssertionID )
else
#endif
if ( !g_pmAssertionID )
{
// Use power manager API for < 10.9 systems
IOReturn success = IOPMAssertionCreateWithName
@@ -72,6 +75,7 @@ bool UpdatePowerResourceUsage(wxPowerResourceKind kind, const wxString& reason)
else if ( g_powerResourceSystemRefCount == 0 )
{
// Release power assertion
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
if ( UMAGetSystemVersion() >= 0x1090 )
{
// Use NSProcessInfo for 10.9 and newer
@@ -84,7 +88,9 @@ bool UpdatePowerResourceUsage(wxPowerResourceKind kind, const wxString& reason)
return true;
}
}
else if ( g_pmAssertionID )
else
#endif
if ( g_pmAssertionID )
{
// Use power manager API for < 10.9 systems
IOReturn success = IOPMAssertionRelease(g_pmAssertionID);