graphicsdriver/metal/ca: Suppress warnings (#767)

This commit is contained in:
Hajime Hoshi 2019-01-02 01:16:54 +09:00
parent ac6ad717b7
commit 623bfde007

View File

@ -48,8 +48,11 @@ const char *MetalLayer_SetMaximumDrawableCount(void *metalLayer,
uint_t maximumDrawableCount) {
if (@available(macOS 10.13.2, *)) {
@try {
[((CAMetalLayer *)metalLayer)
setMaximumDrawableCount:(NSUInteger)maximumDrawableCount];
if ([(CAMetalLayer *)metalLayer
respondsToSelector:@selector(setMaximumDrawableCount:)]) {
[((CAMetalLayer *)metalLayer)
setMaximumDrawableCount:(NSUInteger)maximumDrawableCount];
}
} @catch (NSException *exception) {
return exception.reason.UTF8String;
}
@ -60,7 +63,10 @@ const char *MetalLayer_SetMaximumDrawableCount(void *metalLayer,
void MetalLayer_SetDisplaySyncEnabled(void *metalLayer,
BOOL displaySyncEnabled) {
if (@available(macOS 10.13, *)) {
[((CAMetalLayer *)metalLayer) setDisplaySyncEnabled:displaySyncEnabled];
if ([(CAMetalLayer *)metalLayer
respondsToSelector:@selector(setDisplaySyncEnabled:)]) {
[((CAMetalLayer *)metalLayer) setDisplaySyncEnabled:displaySyncEnabled];
}
}
}