Copypaste SDL_NSLog to UIKit backend, document it as such
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Wed, 17 Jul 2019 23:20:57 -0400
changeset 1295005dddfb66b85
parent 12949 210165cb89ce
child 12951 bc90ce38f1e2
Copypaste SDL_NSLog to UIKit backend, document it as such
src/SDL_log.c
src/video/cocoa/SDL_cocoavideo.m
src/video/uikit/SDL_uikitvideo.m
     1.1 --- a/src/SDL_log.c	Thu Jul 18 19:33:17 2019 -0700
     1.2 +++ b/src/SDL_log.c	Wed Jul 17 23:20:57 2019 -0400
     1.3 @@ -400,8 +400,8 @@
     1.4          SDL_snprintf(tag, SDL_arraysize(tag), "SDL/%s", GetCategoryPrefix(category));
     1.5          __android_log_write(SDL_android_priority[priority], tag, message);
     1.6      }
     1.7 -#elif defined(__APPLE__) && defined(SDL_VIDEO_DRIVER_COCOA)
     1.8 -    /* Technically we don't need SDL_VIDEO_DRIVER_COCOA, but that's where this function is defined for now.
     1.9 +#elif defined(__APPLE__) && (defined(SDL_VIDEO_DRIVER_COCOA) || defined(SDL_VIDEO_DRIVER_UIKIT))
    1.10 +    /* Technically we don't need Cocoa/UIKit, but that's where this function is defined for now.
    1.11      */
    1.12      extern void SDL_NSLog(const char *text);
    1.13      {
     2.1 --- a/src/video/cocoa/SDL_cocoavideo.m	Thu Jul 18 19:33:17 2019 -0700
     2.2 +++ b/src/video/cocoa/SDL_cocoavideo.m	Wed Jul 17 23:20:57 2019 -0400
     2.3 @@ -252,6 +252,9 @@
     2.4   *
     2.5   * This doesn't really have aything to do with the interfaces of the SDL video
     2.6   *  subsystem, but we need to stuff this into an Objective-C source code file.
     2.7 + *
     2.8 + * NOTE: This is copypasted in src/video/uikit/SDL_uikitvideo.m! Be sure both
     2.9 + *  versions remain identical!
    2.10   */
    2.11  
    2.12  void SDL_NSLog(const char *text)
     3.1 --- a/src/video/uikit/SDL_uikitvideo.m	Thu Jul 18 19:33:17 2019 -0700
     3.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Wed Jul 17 23:20:57 2019 -0400
     3.3 @@ -247,12 +247,18 @@
     3.4   *
     3.5   * This doesn't really have aything to do with the interfaces of the SDL video
     3.6   *  subsystem, but we need to stuff this into an Objective-C source code file.
     3.7 + *
     3.8 + * NOTE: This is copypasted from src/video/cocoa/SDL_cocoavideo.m! Thus, if
     3.9 + *  Cocoa is supported, we use that one instead. Be sure both versions remain
    3.10 + *  identical!
    3.11   */
    3.12  
    3.13 +#if !defined(SDL_VIDEO_DRIVER_COCOA)
    3.14  void SDL_NSLog(const char *text)
    3.15  {
    3.16      NSLog(@"%s", text);
    3.17  }
    3.18 +#endif /* SDL_VIDEO_DRIVER_COCOA */
    3.19  
    3.20  /*
    3.21   * iOS Tablet detection