Skip to content

Commit

Permalink
Hide call to requestAccessForMediaType when compiling on macOS < 10.14.
Browse files Browse the repository at this point in the history
This should fix the compilation error in BGMAppDelegate when compiling
against a macOS SDK earlier than 10.14.
  • Loading branch information
kyleneideck committed Oct 3, 2018
1 parent 75e8d5c commit 1a49802
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion BGMApp/BGMApp/BGMAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down

0 comments on commit 1a49802

Please sign in to comment.