From 1265d7546c31609e910d36613cef3eef99d69817 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 31 Aug 2018 19:19:42 +0200 Subject: [PATCH] Revert "Start using raw constants for OSX version detection" This reverts commit ab34a70873637232be341f1c07544d9749e6dddb. --- 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, 18 insertions(+), 6 deletions(-) diff --git a/frontend/drivers/platform_darwin.m b/frontend/drivers/platform_darwin.m index 12a9004f93..fc026ada7d 100644 --- a/frontend/drivers/platform_darwin.m +++ b/frontend/drivers/platform_darwin.m @@ -286,13 +286,17 @@ 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 >= 101000 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 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 69911d0cdb..a95478f59d 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 < 1050 +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 if (g_format == nil) { /* NSOpenGLFPAAllowOfflineRenderers is diff --git a/gfx/drivers_context/macos_ctx.m b/gfx/drivers_context/macos_ctx.m index 64c92a0e76..fb518060cf 100644 --- a/gfx/drivers_context/macos_ctx.m +++ b/gfx/drivers_context/macos_ctx.m @@ -404,6 +404,10 @@ 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) @@ -446,7 +450,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data, } #endif -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 if (g_major == 4 && g_minor == 1) { attributes[6] = NSOpenGLPFAOpenGLProfile; @@ -456,7 +460,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data, g_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 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 74b6829954..819b39ecf6 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 <= 1040) +#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4) typedef int NSInteger; typedef unsigned NSUInteger; typedef float CGFloat; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index c089da2991..2c4e1fb7b7 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -42,7 +42,11 @@ #import #endif -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 +#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 @interface WindowListener : NSResponder @end