SDL backend, macOs warning build fixes proposal.

This commit is contained in:
David CARLIER 2021-10-18 19:40:18 +01:00 committed by Daniel Gibson
parent 0958d8464a
commit 3bf55225ab

View file

@ -5,12 +5,17 @@
Feel free to customize this file to suit your needs Feel free to customize this file to suit your needs
*/ */
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#include "SDL.h" #include "SDL.h"
#include "SDLMain.h" #include "SDLMain.h"
#include <sys/param.h> /* for MAXPATHLEN */ #include <sys/param.h> /* for MAXPATHLEN */
#include <unistd.h> #include <unistd.h>
/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, /* For some reason, Apple removed setAppleMenu from the headers in 10.4,
but the method still is there and works. To avoid warnings, we declare but the method still is there and works. To avoid warnings, we declare
it ourselves here. */ it ourselves here. */
@interface NSApplication(SDL_Missing_Methods) @interface NSApplication(SDL_Missing_Methods)
@ -221,7 +226,7 @@ static void CustomApplicationMain (int argc, char **argv)
/* Create SDLMain and make it the app delegate */ /* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init]; sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain]; [NSApp setDelegate:(id<NSApplicationDelegate>)sdlMain];
/* Start the main event loop */ /* Start the main event loop */
[NSApp run]; [NSApp run];
@ -378,3 +383,7 @@ int main (int argc, char **argv)
#endif #endif
return 0; return 0;
} }
#if defined(__clang__)
#pragma clang diagnostic pop
#endif