mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
macOS/iOS: Fix unguarded availability warnings
This commit is contained in:
parent
e984395b1d
commit
db3c6e6216
27 changed files with 220 additions and 177 deletions
|
|
@ -28,12 +28,21 @@ namespace juce
|
|||
class ScopedLowPowerModeDisabler::Pimpl
|
||||
{
|
||||
public:
|
||||
Pimpl() = default;
|
||||
~Pimpl() { [[NSProcessInfo processInfo] endActivity: activity]; }
|
||||
Pimpl()
|
||||
{
|
||||
if (@available (macOS 10.9, *))
|
||||
activity = [[NSProcessInfo processInfo] beginActivityWithOptions: NSActivityUserInitiatedAllowingIdleSystemSleep
|
||||
reason: @"App must remain in high-power mode"];
|
||||
}
|
||||
|
||||
~Pimpl()
|
||||
{
|
||||
if (@available (macOS 10.9, *))
|
||||
[[NSProcessInfo processInfo] endActivity: activity];
|
||||
}
|
||||
|
||||
private:
|
||||
id activity { [[NSProcessInfo processInfo] beginActivityWithOptions: NSActivityUserInitiatedAllowingIdleSystemSleep
|
||||
reason: @"App must remain in high-power mode"] };
|
||||
id activity;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE (Pimpl)
|
||||
JUCE_DECLARE_NON_MOVEABLE (Pimpl)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue