Worked around "Undefined symbol: ___isPlatformVersionAtLeast()" link error on Xcode 11 beta
authorSam Lantinga <slouken@libsdl.org>
Fri, 14 Jun 2019 13:56:42 -0700
changeset 128600f52dd40abe5
parent 12859 6a71489fe580
child 12861 7409d02471b3
Worked around "Undefined symbol: ___isPlatformVersionAtLeast()" link error on Xcode 11 beta
src/render/metal/SDL_render_metal.m
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitviewcontroller.m
     1.1 --- a/src/render/metal/SDL_render_metal.m	Fri Jun 14 16:52:42 2019 -0400
     1.2 +++ b/src/render/metal/SDL_render_metal.m	Fri Jun 14 13:56:42 2019 -0700
     1.3 @@ -1733,11 +1733,12 @@
     1.4  #endif
     1.5  #else
     1.6  #ifdef __IPHONE_11_0
     1.7 -    if (@available(iOS 11.0, *)) {
     1.8 -        if ([mtldevice supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily4_v1]) {
     1.9 -            maxtexsize = 16384;
    1.10 -        }
    1.11 +#pragma clang diagnostic push
    1.12 +#pragma clang diagnostic ignored "-Wunguarded-availability-new"
    1.13 +    if ([mtldevice supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily4_v1]) {
    1.14 +        maxtexsize = 16384;
    1.15      } else
    1.16 +#pragma clang diagnostic pop
    1.17  #endif
    1.18  #ifdef __IPHONE_10_0
    1.19      if ([mtldevice supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily3_v1]) {
     2.1 --- a/src/video/uikit/SDL_uikitvideo.m	Fri Jun 14 16:52:42 2019 -0400
     2.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Fri Jun 14 13:56:42 2019 -0700
     2.3 @@ -230,10 +230,13 @@
     2.4      if (focus) {
     2.5          SDL_WindowData *data = (__bridge SDL_WindowData *) focus->driverdata;
     2.6          if (data != nil) {
     2.7 -            if (@available(iOS 11.0, *)) {
     2.8 +#pragma clang diagnostic push
     2.9 +#pragma clang diagnostic ignored "-Wunguarded-availability-new"
    2.10 +            if ([data.viewcontroller respondsToSelector:@selector(setNeedsUpdateOfHomeIndicatorAutoHidden)]) {
    2.11                  [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfHomeIndicatorAutoHidden) withObject:nil waitUntilDone:NO];
    2.12                  [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfScreenEdgesDeferringSystemGestures) withObject:nil waitUntilDone:NO];
    2.13              }
    2.14 +#pragma clang diagnostic pop
    2.15          }
    2.16      }
    2.17  #endif /* !TARGET_OS_TV */
     3.1 --- a/src/video/uikit/SDL_uikitviewcontroller.m	Fri Jun 14 16:52:42 2019 -0400
     3.2 +++ b/src/video/uikit/SDL_uikitviewcontroller.m	Fri Jun 14 13:56:42 2019 -0700
     3.3 @@ -57,10 +57,13 @@
     3.4      @autoreleasepool {
     3.5          SDL_uikitviewcontroller *viewcontroller = (__bridge SDL_uikitviewcontroller *) userdata;
     3.6          viewcontroller.homeIndicatorHidden = (hint && *hint) ? SDL_atoi(hint) : -1;
     3.7 -        if (@available(iOS 11.0, *)) {
     3.8 +#pragma clang diagnostic push
     3.9 +#pragma clang diagnostic ignored "-Wunguarded-availability-new"
    3.10 +        if ([viewcontroller respondsToSelector:@selector(setNeedsUpdateOfHomeIndicatorAutoHidden)]) {
    3.11              [viewcontroller setNeedsUpdateOfHomeIndicatorAutoHidden];
    3.12              [viewcontroller setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
    3.13          }
    3.14 +#pragma clang diagnostic pop
    3.15      }
    3.16  }
    3.17  #endif