[Scummvm-git-logs] scummvm master -> b8132baa943f3a9c82886ea074a34140aa2557f5

criezy criezy at scummvm.org
Mon Oct 11 18:40:40 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b8132baa94 SDL: Fix building/deployment on macOS <10.7


Commit: b8132baa943f3a9c82886ea074a34140aa2557f5
    https://github.com/scummvm/scummvm/commit/b8132baa943f3a9c82886ea074a34140aa2557f5
Author: Evan Miller (emmiller at gmail.com)
Date: 2021-10-11T19:40:37+01:00

Commit Message:
SDL: Fix building/deployment on macOS <10.7

NSWindow.backingScaleFactor needs OS support, so a run-time test is
necessary in addition to the OS X SDK guard.

Changed paths:
    backends/platform/sdl/macosx/macosx-compat.h
    backends/platform/sdl/macosx/macosx-window.mm


diff --git a/backends/platform/sdl/macosx/macosx-compat.h b/backends/platform/sdl/macosx/macosx-compat.h
index 499903a1d0..464b24d589 100644
--- a/backends/platform/sdl/macosx/macosx-compat.h
+++ b/backends/platform/sdl/macosx/macosx-compat.h
@@ -33,6 +33,10 @@
 #define MAC_OS_X_VERSION_10_6    1060
 #endif
 
+#ifndef MAC_OS_X_VERSION_10_7
+#define MAC_OS_X_VERSION_10_7    1070
+#endif
+
 #ifndef MAC_OS_X_VERSION_10_10
 #define MAC_OS_X_VERSION_10_10 101000
 #endif
diff --git a/backends/platform/sdl/macosx/macosx-window.mm b/backends/platform/sdl/macosx/macosx-window.mm
index 88e87880c3..e4fb29cfb5 100644
--- a/backends/platform/sdl/macosx/macosx-window.mm
+++ b/backends/platform/sdl/macosx/macosx-window.mm
@@ -24,6 +24,7 @@
 #define FORBIDDEN_SYMBOL_ALLOW_ALL
 
 #include "backends/platform/sdl/macosx/macosx-window.h"
+#include "backends/platform/sdl/macosx/macosx-compat.h"
 #include <AppKit/NSWindow.h>
 
 float SdlWindow_MacOSX::getDpiScalingFactor() const {
@@ -31,7 +32,7 @@ float SdlWindow_MacOSX::getDpiScalingFactor() const {
 	SDL_SysWMinfo wmInfo;
 	if (getSDLWMInformation(&wmInfo)) {
 		NSWindow *nswindow = wmInfo.info.cocoa.window;
-		if (nswindow)
+		if ([nswindow respondsToSelector:@selector(backingScaleFactor)])
 			return [nswindow backingScaleFactor];
 	}
 #endif




More information about the Scummvm-git-logs mailing list