Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: instance method '-isOperatingSystemAtLeastVersion:' not found #3839

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.0
Reported for operating system, platform: Mac OS X 10.8, All

Comments on the original bug report:

On 2020-10-05 22:40:17 +0000, Ozkan Sezer wrote:

Building the current tree against 10.8 SDK, clang emits the following warning:

src/video/cocoa/SDL_cocoawindow.m:1846:27: warning: instance method '-isOperatingSystemAtLeastVersion:' not found (return type defaults to 'id') [-Wobjc-method-access]
![processInfo isOperatingSystemAtLeastVersion:version]) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSProcessInfo.h:20:12: note: receiver is instance of class declared here
@interface NSProcessInfo : NSObject {
^
1 warning generated.

The call was introduced by https://hg.libsdl.org/SDL/rev/a6d3d330dedc
PS: isOperatingSystemAtLeastVersion is an 10.10 thing.

On 2020-10-07 13:44:28 +0000, Ozkan Sezer wrote:

Is the following patch OK?

diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -57,6 +57,9 @@
#ifndef MAC_OS_X_VERSION_10_12
#define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask
#endif
+#ifndef NSAppKitVersionNumber10_14
+#define NSAppKitVersionNumber10_14 1671
+#endif

@interface SDLWindow : NSWindow
/* These are needed for borderless/fullscreen windows /
@@ -1833,17 +1836,7 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Win
/
Hack to fix origin on Mac OS X 10.4
This is no longer needed as of Mac OS X 10.15, according to bug 4822.
*/

  •    NSProcessInfo *processInfo = [NSProcessInfo processInfo];
    

-#if MAC_OS_X_VERSION_MAX_ALLOWED < 101000 /* NSOperatingSystemVersion added in the 10.10 SDK */

  •    typedef struct {
    
  •        NSInteger majorVersion;
    
  •        NSInteger minorVersion;
    
  •        NSInteger patchVersion;
    
  •    } NSOperatingSystemVersion;
    

-#endif

  •    NSOperatingSystemVersion version = { 10, 15, 0 };
    
  •    if (![processInfo respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] ||
    
  •        ![processInfo isOperatingSystemAtLeastVersion:version]) {
    
  •    if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_14) {
           NSRect screenRect = [[nswindow screen] frame];
           if (screenRect.size.height >= 1.0f) {
               rect.origin.y += (screenRect.size.height - rect.size.height);
    

On 2020-10-09 01:01:17 +0000, Ozkan Sezer wrote:

Applied https://hg.libsdl.org/SDL/rev/dc437e72435f
Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant