Hide call to requestAccessForMediaType when compiling on macOS < 10.14.

This should fix the compilation error in BGMAppDelegate when compiling
against a macOS SDK earlier than 10.14.
This commit is contained in:
Kyle Neideck 2018-10-03 18:40:22 +10:00
parent 75e8d5ceac
commit 1a49802675
No known key found for this signature in database
GPG key ID: CAA8D9B8E39EC18C

View file

@ -216,6 +216,9 @@ static NSString* const kOptShowDockIcon = @"--show-dock-icon";
}
};
// Skip this if we're compiling on a version of macOS before 10.14 as won't compile and it
// isn't needed.
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 // MAC_OS_X_VERSION_10_14
if (@available(macOS 10.14, *)) {
// On macOS 10.14+ we need to get the user's permission to use input devices before we can
// use BGMDevice for playthrough (see BGMPlayThrough), so we wait until they've given it
@ -240,7 +243,10 @@ static NSString* const kOptShowDockIcon = @"--show-dock-icon";
// with instructions.
}
}];
} else {
}
else
#endif
{
// We can change the device immediately on older versions of macOS because they don't
// require user permission for input devices.
setDefaultDevice();