From 1a49802675933975e27ef94ed31af01a1f2809c0 Mon Sep 17 00:00:00 2001 From: Kyle Neideck Date: Wed, 3 Oct 2018 18:40:22 +1000 Subject: [PATCH] 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. --- BGMApp/BGMApp/BGMAppDelegate.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BGMApp/BGMApp/BGMAppDelegate.mm b/BGMApp/BGMApp/BGMAppDelegate.mm index a6dd3ea2..26a05d2c 100644 --- a/BGMApp/BGMApp/BGMAppDelegate.mm +++ b/BGMApp/BGMApp/BGMAppDelegate.mm @@ -216,6 +216,9 @@ - (void) setBGMDeviceAsDefault { } }; + // 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 @@ - (void) setBGMDeviceAsDefault { // 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();