Revert "Start using raw constants for OSX version detection"

This reverts commit ab34a70873637232be341f1c07544d9749e6dddb.
This commit is contained in:
twinaphex 2018-08-31 19:19:42 +02:00
parent c7af7ae00d
commit 1265d7546c
5 changed files with 18 additions and 6 deletions

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -42,7 +42,11 @@
#import <MetalKit/MetalKit.h>
#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<NSWindowDelegate>
@end