Skip to content

Commit ab34a70

Browse files
committed
Start using raw constants for OSX version detection
1 parent f35b578 commit ab34a70

File tree

5 files changed

+6
-18
lines changed

5 files changed

+6
-18
lines changed

frontend/drivers/platform_darwin.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,13 @@ static void frontend_darwin_get_name(char *s, size_t len)
286286
#endif
287287
}
288288

289-
#ifndef MAC_OS_X_VERSION_10_10
290-
#define MAC_OS_X_VERSION_10_10 101000
291-
#endif
292-
293289
static void frontend_darwin_get_os(char *s, size_t len, int *major, int *minor)
294290
{
295291
#if defined(IOS)
296292
get_ios_version(major, minor);
297293
strlcpy(s, "iOS", len);
298294
#elif defined(OSX)
299-
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
295+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
300296
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
301297
*major = (int)version.majorVersion;
302298
*minor = (int)version.minorVersion;

gfx/drivers_context/cocoa_gl_ctx.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data,
365365

366366
g_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
367367

368-
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
368+
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
369369
if (g_format == nil)
370370
{
371371
/* NSOpenGLFPAAllowOfflineRenderers is

gfx/drivers_context/macos_ctx.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,6 @@ static void cocoagl_gfx_ctx_show_mouse(void *data, bool state)
404404
#endif
405405
}
406406

407-
#ifndef MAC_OS_X_VERSION_10_10
408-
#define MAC_OS_X_VERSION_10_10 101000
409-
#endif
410-
411407
static bool cocoagl_gfx_ctx_set_video_mode(void *data,
412408
video_frame_info_t *video_info,
413409
unsigned width, unsigned height, bool fullscreen)
@@ -450,7 +446,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data,
450446
}
451447
#endif
452448

453-
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
449+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
454450
if (g_major == 4 && g_minor == 1)
455451
{
456452
attributes[6] = NSOpenGLPFAOpenGLProfile;
@@ -460,7 +456,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data,
460456

461457
g_format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
462458

463-
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
459+
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
464460
if (g_format == nil)
465461
{
466462
/* NSOpenGLFPAAllowOfflineRenderers is

libretro-common/include/compat/apple_compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#ifdef __OBJC__
3131

32-
#if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4)
32+
#if (MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)
3333
typedef int NSInteger;
3434
typedef unsigned NSUInteger;
3535
typedef float CGFloat;

ui/drivers/ui_cocoa.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@
4242
#import <MetalKit/MetalKit.h>
4343
#endif
4444

45-
#ifndef MAC_OS_X_VERSION_10_6
46-
#define MAC_OS_X_VERSION_10_6 1060
47-
#endif
48-
49-
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
45+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
5046
@interface WindowListener : NSResponder<NSWindowDelegate>
5147
@end
5248

0 commit comments

Comments
 (0)