From ab34a70873637232be341f1c07544d9749e6dddb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 30 Aug 2018 16:35:44 +0200 Subject: [PATCH] Start using raw constants for OSX version detection --- frontend/drivers/platform_darwin.m | 6 +----- gfx/drivers_context/cocoa_gl_ctx.m | 2 +- gfx/drivers_context/macos_ctx.m | 8 ++------ libretro-common/include/compat/apple_compat.h | 2 +- ui/drivers/ui_cocoa.m | 6 +----- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/frontend/drivers/platform_darwin.m b/frontend/drivers/platform_darwin.m index fc026ada7d..12a9004f93 100644 --- a/frontend/drivers/platform_darwin.m +++ b/frontend/drivers/platform_darwin.m @@ -286,17 +286,13 @@ static void frontend_darwin_get_name(char *s, size_t len) #endif } -#ifndef MAC_OS_X_VERSION_10_10 -#define MAC_OS_X_VERSION_10_10 101000 -#endif - static void frontend_darwin_get_os(char *s, size_t len, int *major, int *minor) { #if defined(IOS) get_ios_version(major, minor); strlcpy(s, "iOS", len); #elif defined(OSX) -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; *major = (int)version.majorVersion; *minor = (int)version.minorVersion; diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index a95478f59d..69911d0cdb 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -365,7 +365,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data, g_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 if (g_format == nil) { /* NSOpenGLFPAAllowOfflineRenderers is diff --git a/gfx/drivers_context/macos_ctx.m b/gfx/drivers_context/macos_ctx.m index fb518060cf..64c92a0e76 100644 --- a/gfx/drivers_context/macos_ctx.m +++ b/gfx/drivers_context/macos_ctx.m @@ -404,10 +404,6 @@ static void cocoagl_gfx_ctx_show_mouse(void *data, bool state) #endif } -#ifndef MAC_OS_X_VERSION_10_10 -#define MAC_OS_X_VERSION_10_10 101000 -#endif - static bool cocoagl_gfx_ctx_set_video_mode(void *data, video_frame_info_t *video_info, unsigned width, unsigned height, bool fullscreen) @@ -450,7 +446,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data, } #endif -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 if (g_major == 4 && g_minor == 1) { attributes[6] = NSOpenGLPFAOpenGLProfile; @@ -460,7 +456,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data, g_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 if (g_format == nil) { /* NSOpenGLFPAAllowOfflineRenderers is diff --git a/libretro-common/include/compat/apple_compat.h b/libretro-common/include/compat/apple_compat.h index 819b39ecf6..74b6829954 100644 --- a/libretro-common/include/compat/apple_compat.h +++ b/libretro-common/include/compat/apple_compat.h @@ -29,7 +29,7 @@ #ifdef __OBJC__ -#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) +#if (MAC_OS_X_VERSION_MAX_ALLOWED <= 1040) typedef int NSInteger; typedef unsigned NSUInteger; typedef float CGFloat; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 2c4e1fb7b7..c089da2991 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -42,11 +42,7 @@ #import #endif -#ifndef MAC_OS_X_VERSION_10_6 -#define MAC_OS_X_VERSION_10_6 1060 -#endif - -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 @interface WindowListener : NSResponder @end