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

COSOperator: Use NSPasteboardTypeString instead of NSStringPboardType #15716

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

stefanbeller
Copy link
Contributor

According to https://developer.apple.com/documentation/appkit/nsstringpboardtype?language=objc we can replace it with NSPasteboardTypeString:

In apps that adopt App Sandbox, use an NSURL object, a bookmark, or a
filename pasteboard type instead. In a nonsandboxed app, you can also
use the NSPasteboardTypeString pasteboard type.

Add compact, short information about your PR for easier understanding:

  • Goal of the PR: remove a deprecation warning
  • How does the PR work? use newer type; test if pasting text into chat console still works (as expected)
Screenshot 2025-01-25 at 1 10 51 PM

This PR is Ready for Review.

How to test

I assume just pasting text from the OS clipboard anywhere would be a sufficient test.

According to https://developer.apple.com/documentation/appkit/nsstringpboardtype?language=objc
we can replace it with NSPasteboardTypeString:

> In apps that adopt App Sandbox, use an NSURL object, a bookmark, or a
> filename pasteboard type instead. In a nonsandboxed app, you can also
> use the NSPasteboardTypeString pasteboard type.
@stefanbeller
Copy link
Contributor Author

I just realize this is all part of the Irrlicht engine, closing it here

@appgurueu appgurueu reopened this Jan 25, 2025
@appgurueu
Copy link
Contributor

No, Irrlicht PRs are right here. We've forked and stripped down Irrlicht and are maintaining our fork in this repo (it used to be separate, but that caused too much trouble).

@appgurueu appgurueu added Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines One approval ✅ ◻️ labels Jan 25, 2025
@sfan5 sfan5 added the macOS label Jan 25, 2025
@stefanbeller
Copy link
Contributor Author

No, Irrlicht PRs are right here.

That's good to know, there are 2-3 more files that need to be fixed regarding deprecation warnings.

Would you prefer to pile it all up into one (this) PR and label it as "macOS: replace all deprecated function calls" or rather have it trickle in with such small PRs?

Also as I see #13285 pinned, I'd expect those changes to be merged after the next release?

@sfan5
Copy link
Collaborator

sfan5 commented Jan 26, 2025

If you have more fixes feel free to add them here.

Also as I see #13285 pinned, I'd expect those changes to be merged after the next release?

Resolving deprecation warnings counts as bug fix, and is exempt.

@stefanbeller
Copy link
Contributor Author

As of now, the call dropped was supported in version macOS 10.0–10.14, and the new call is in macOS 10.6+, effectively
raising the minimum version from 10.0 to 10.6. Mac OS X 10.6 Snow Leopard was released on August 28, 2009. So that should be plenty of time to upgrade.

The remaining warnings are in 3 files, I'll take a look at resolving them, the latest is first deprecated in macOS 10.14, which puts us at a September 24, 2018 timeline, which is still plenty IMHO.

[ 21%] Building CXX object irr/src/CMakeFiles/IRROTHEROBJ.dir/CIrrDeviceOSX.mm.o
In file included from /Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:30:
/Users/stefanbeller/luanti/irr/src/CNSOGLManager.h:49:27: warning: 'getContext' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   49 |         const SExposedVideoData &getContext() const;
      |                                  ^
/Users/stefanbeller/luanti/irr/include/IContextManager.h:38:35: note: overridden virtual function is here
   38 |         virtual const SExposedVideoData &getContext() const = 0;
      |                                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:520:48: warning: implicit conversion of NULL constant to 'CGDirectDisplayID' (aka 'unsigned int') [-Wnull-conversion]
  520 |                 CIrrDeviceStub(param), Window(NULL), Display(NULL),
      |                                                             ~^~~~
      |                                                              0
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:546:43: warning: 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  546 |                         [menuItem setKeyEquivalentModifierMask:NSCommandKeyMask];
      |                                                                ^~~~~~~~~~~~~~~~
      |                                                                NSEventModifierFlagCommand
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:181:35: note: 'NSCommandKeyMask' has been explicitly marked deprecated here
  181 | static const NSEventModifierFlags NSCommandKeyMask            API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagCommand", macos(10.0,10.12)) = NSEventModifierFlagCommand;
      |                                   ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:620:110: warning: 'NSBackingStoreNonretained' is deprecated: first deprecated in macOS 10.13 [-Wdeprecated-declarations]
  620 |         const NSBackingStoreType type = (CreationParams.DriverType == video::EDT_OPENGL) ? NSBackingStoreBuffered : NSBackingStoreNonretained;
      |                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                                                     NSBackingStoreBuffered
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:98:5: note: 'NSBackingStoreNonretained' has been explicitly marked deprecated here
   98 |     NSBackingStoreNonretained API_DEPRECATED_WITH_REPLACEMENT("NSBackingStoreBuffered", macos(10.0,10.13)) = 1,
      |     ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:634:145: warning: 'NSTitledWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  634 |                         Window = [[NSWindow alloc] initWithContentRect:NSMakeRect(x, y, CreationParams.WindowSize.Width, CreationParams.WindowSize.Height) styleMask:NSTitledWindowMask + NSClosableWindowMask + NSResizableWindowMask backing:type defer:FALSE];
      |                                                                                                                                                                      ^~~~~~~~~~~~~~~~~~
      |                                                                                                                                                                      NSWindowStyleMaskTitled
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:1043:32: note: 'NSTitledWindowMask' has been explicitly marked deprecated here
 1043 | static const NSWindowStyleMask NSTitledWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskTitled", macos(10.0,10.12)) = NSWindowStyleMaskTitled;
      |                                ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:634:166: warning: 'NSClosableWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  634 |                         Window = [[NSWindow alloc] initWithContentRect:NSMakeRect(x, y, CreationParams.WindowSize.Width, CreationParams.WindowSize.Height) styleMask:NSTitledWindowMask + NSClosableWindowMask + NSResizableWindowMask backing:type defer:FALSE];
      |                                                                                                                                                                                           ^~~~~~~~~~~~~~~~~~~~
      |                                                                                                                                                                                           NSWindowStyleMaskClosable
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:1044:32: note: 'NSClosableWindowMask' has been explicitly marked deprecated here
 1044 | static const NSWindowStyleMask NSClosableWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskClosable", macos(10.0,10.12)) = NSWindowStyleMaskClosable;
      |                                ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:634:189: warning: 'NSResizableWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  634 |                         Window = [[NSWindow alloc] initWithContentRect:NSMakeRect(x, y, CreationParams.WindowSize.Width, CreationParams.WindowSize.Height) styleMask:NSTitledWindowMask + NSClosableWindowMask + NSResizableWindowMask backing:type defer:FALSE];
      |                                                                                                                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~
      |                                                                                                                                                                                                                  NSWindowStyleMaskResizable
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:1046:32: note: 'NSResizableWindowMask' has been explicitly marked deprecated here
 1046 | static const NSWindowStyleMask NSResizableWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskResizable", macos(10.0,10.12)) = NSWindowStyleMaskResizable;
      |                                ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:701:71: warning: 'setView:' is deprecated: first deprecated in macOS 10.14 - Use NSOpenGLView to provide OpenGL content in a Cocoa app. [-Wdeprecated-declarations]
  701 |                         [(NSOpenGLContext *)ContextManager->getContext().OpenGLOSX.Context setView:[Window contentView]];
      |                                                                                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:193:36: note: property 'view' is declared deprecated here
  193 | @property (nullable, weak) NSView *view NS_SWIFT_UI_ACTOR API_DEPRECATED("", macos(10.0,10.14));
      |                                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:194:1: note: 'setView:' has been explicitly marked deprecated here
  194 | - (void)setView:(nullable NSView *)view NS_SWIFT_UI_ACTOR API_DEPRECATED("Use NSOpenGLView to provide OpenGL content in a Cocoa app.", macos(10.0,10.14));
      | ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:703:39: warning: 'setWantsBestResolutionOpenGLSurface:' is deprecated: first deprecated in macOS 10.14 - Use NSOpenGLView instead. [-Wdeprecated-declarations]
  703 |                         [(NSView *)CreationParams.WindowId setWantsBestResolutionOpenGLSurface:NO];
      |                                                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLView.h:47:16: note: property 'wantsBestResolutionOpenGLSurface' is declared deprecated here
   47 | @property BOOL wantsBestResolutionOpenGLSurface API_DEPRECATED("Use NSOpenGLView instead.", macos(10.7,10.14));
      |                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLView.h:47:16: note: 'setWantsBestResolutionOpenGLSurface:' has been explicitly marked deprecated here
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:704:71: warning: 'setView:' is deprecated: first deprecated in macOS 10.14 - Use NSOpenGLView to provide OpenGL content in a Cocoa app. [-Wdeprecated-declarations]
  704 |                         [(NSOpenGLContext *)ContextManager->getContext().OpenGLOSX.Context setView:(NSView *)CreationParams.WindowId];
      |                                                                                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:193:36: note: property 'view' is declared deprecated here
  193 | @property (nullable, weak) NSView *view NS_SWIFT_UI_ACTOR API_DEPRECATED("", macos(10.0,10.14));
      |                                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:194:1: note: 'setView:' has been explicitly marked deprecated here
  194 | - (void)setView:(nullable NSView *)view NS_SWIFT_UI_ACTOR API_DEPRECATED("Use NSOpenGLView to provide OpenGL content in a Cocoa app.", macos(10.0,10.14));
      | ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:737:39: warning: 'NSAnyEventMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  737 |         event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
      |                                              ^~~~~~~~~~~~~~
      |                                              NSEventMaskAny
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:158:26: note: 'NSAnyEventMask' has been explicitly marked deprecated here
  158 | static const NSEventMask NSAnyEventMask                 API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskAny", macos(10.0,10.12)) = NSUIntegerMax;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:742:8: warning: 'NSKeyDown' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  742 |                 case NSKeyDown:
      |                      ^~~~~~~~~
      |                      NSEventTypeKeyDown
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:74:26: note: 'NSKeyDown' has been explicitly marked deprecated here
   74 | static const NSEventType NSKeyDown              API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeKeyDown", macos(10.0,10.12)) = NSEventTypeKeyDown;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:746:8: warning: 'NSKeyUp' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  746 |                 case NSKeyUp:
      |                      ^~~~~~~
      |                      NSEventTypeKeyUp
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:75:26: note: 'NSKeyUp' has been explicitly marked deprecated here
   75 | static const NSEventType NSKeyUp                API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeKeyUp", macos(10.0,10.12)) = NSEventTypeKeyUp;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:750:8: warning: 'NSFlagsChanged' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  750 |                 case NSFlagsChanged:
      |                      ^~~~~~~~~~~~~~
      |                      NSEventTypeFlagsChanged
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:76:26: note: 'NSFlagsChanged' has been explicitly marked deprecated here
   76 | static const NSEventType NSFlagsChanged         API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeFlagsChanged", macos(10.0,10.12)) = NSEventTypeFlagsChanged;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:752:64: warning: 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  752 |                         ievent.KeyInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0;
      |                                                                                     ^~~~~~~~~~~~~~
      |                                                                                     NSEventModifierFlagShift
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:178:35: note: 'NSShiftKeyMask' has been explicitly marked deprecated here
  178 | static const NSEventModifierFlags NSShiftKeyMask              API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagShift", macos(10.0,10.12)) = NSEventModifierFlagShift;
      |                                   ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:753:66: warning: 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  753 |                         ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0;
      |                                                                                       ^~~~~~~~~~~~~~~~
      |                                                                                       NSEventModifierFlagControl
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:179:35: note: 'NSControlKeyMask' has been explicitly marked deprecated here
  179 | static const NSEventModifierFlags NSControlKeyMask            API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagControl", macos(10.0,10.12)) = NSEventModifierFlagControl;
      |                                   ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:778:8: warning: 'NSLeftMouseDown' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  778 |                 case NSLeftMouseDown:
      |                      ^~~~~~~~~~~~~~~
      |                      NSEventTypeLeftMouseDown
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:65:26: note: 'NSLeftMouseDown' has been explicitly marked deprecated here
   65 | static const NSEventType NSLeftMouseDown        API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseDown", macos(10.0,10.12)) = NSEventTypeLeftMouseDown;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:786:8: warning: 'NSLeftMouseUp' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  786 |                 case NSLeftMouseUp:
      |                      ^~~~~~~~~~~~~
      |                      NSEventTypeLeftMouseUp
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:66:26: note: 'NSLeftMouseUp' has been explicitly marked deprecated here
   66 | static const NSEventType NSLeftMouseUp          API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseUp", macos(10.0,10.12)) = NSEventTypeLeftMouseUp;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:794:8: warning: 'NSOtherMouseDown' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  794 |                 case NSOtherMouseDown:
      |                      ^~~~~~~~~~~~~~~~
      |                      NSEventTypeOtherMouseDown
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:85:26: note: 'NSOtherMouseDown' has been explicitly marked deprecated here
   85 | static const NSEventType NSOtherMouseDown       API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseDown", macos(10.0,10.12)) = NSEventTypeOtherMouseDown;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:802:8: warning: 'NSOtherMouseUp' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  802 |                 case NSOtherMouseUp:
      |                      ^~~~~~~~~~~~~~
      |                      NSEventTypeOtherMouseUp
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:86:26: note: 'NSOtherMouseUp' has been explicitly marked deprecated here
   86 | static const NSEventType NSOtherMouseUp         API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseUp", macos(10.0,10.12)) = NSEventTypeOtherMouseUp;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:810:8: warning: 'NSMouseMoved' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  810 |                 case NSMouseMoved:
      |                      ^~~~~~~~~~~~
      |                      NSEventTypeMouseMoved
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:69:26: note: 'NSMouseMoved' has been explicitly marked deprecated here
   69 | static const NSEventType NSMouseMoved           API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeMouseMoved", macos(10.0,10.12)) = NSEventTypeMouseMoved;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:811:8: warning: 'NSLeftMouseDragged' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  811 |                 case NSLeftMouseDragged:
      |                      ^~~~~~~~~~~~~~~~~~
      |                      NSEventTypeLeftMouseDragged
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:70:26: note: 'NSLeftMouseDragged' has been explicitly marked deprecated here
   70 | static const NSEventType NSLeftMouseDragged     API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseDragged", macos(10.0,10.12)) = NSEventTypeLeftMouseDragged;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:812:8: warning: 'NSRightMouseDragged' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  812 |                 case NSRightMouseDragged:
      |                      ^~~~~~~~~~~~~~~~~~~
      |                      NSEventTypeRightMouseDragged
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:71:26: note: 'NSRightMouseDragged' has been explicitly marked deprecated here
   71 | static const NSEventType NSRightMouseDragged    API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseDragged", macos(10.0,10.12)) = NSEventTypeRightMouseDragged;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:813:8: warning: 'NSOtherMouseDragged' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  813 |                 case NSOtherMouseDragged:
      |                      ^~~~~~~~~~~~~~~~~~~
      |                      NSEventTypeOtherMouseDragged
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:87:26: note: 'NSOtherMouseDragged' has been explicitly marked deprecated here
   87 | static const NSEventType NSOtherMouseDragged    API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseDragged", macos(10.0,10.12)) = NSEventTypeOtherMouseDragged;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:820:8: warning: 'NSRightMouseDown' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  820 |                 case NSRightMouseDown:
      |                      ^~~~~~~~~~~~~~~~
      |                      NSEventTypeRightMouseDown
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:67:26: note: 'NSRightMouseDown' has been explicitly marked deprecated here
   67 | static const NSEventType NSRightMouseDown       API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseDown", macos(10.0,10.12)) = NSEventTypeRightMouseDown;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:828:8: warning: 'NSRightMouseUp' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  828 |                 case NSRightMouseUp:
      |                      ^~~~~~~~~~~~~~
      |                      NSEventTypeRightMouseUp
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:68:26: note: 'NSRightMouseUp' has been explicitly marked deprecated here
   68 | static const NSEventType NSRightMouseUp         API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseUp", macos(10.0,10.12)) = NSEventTypeRightMouseUp;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:836:8: warning: 'NSScrollWheel' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  836 |                 case NSScrollWheel:
      |                      ^~~~~~~~~~~~~
      |                      NSEventTypeScrollWheel
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:82:26: note: 'NSScrollWheel' has been explicitly marked deprecated here
   82 | static const NSEventType NSScrollWheel          API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeScrollWheel", macos(10.0,10.12)) = NSEventTypeScrollWheel;
      |                          ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:858:29: warning: instance method '-isQuit' not found (return type defaults to 'id') [-Wobjc-method-access]
  858 |         return (![[NSApp delegate] isQuit] && IsActive);
      |                                    ^~~~~~
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:957:45: warning: 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  957 |                                         if ([(NSEvent *)event modifierFlags] & NSCommandKeyMask) {
      |                                                                                ^~~~~~~~~~~~~~~~
      |                                                                                NSEventModifierFlagCommand
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:181:35: note: 'NSCommandKeyMask' has been explicitly marked deprecated here
  181 | static const NSEventModifierFlags NSCommandKeyMask            API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagCommand", macos(10.0,10.12)) = NSEventModifierFlagCommand;
      |                                   ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:970:63: warning: 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  970 |                 ievent.KeyInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0;
      |                                                                             ^~~~~~~~~~~~~~
      |                                                                             NSEventModifierFlagShift
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:178:35: note: 'NSShiftKeyMask' has been explicitly marked deprecated here
  178 | static const NSEventModifierFlags NSShiftKeyMask              API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagShift", macos(10.0,10.12)) = NSEventModifierFlagShift;
      |                                   ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:971:65: warning: 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  971 |                 ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0;
      |                                                                               ^~~~~~~~~~~~~~~~
      |                                                                               NSEventModifierFlagControl
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:179:35: note: 'NSControlKeyMask' has been explicitly marked deprecated here
  179 | static const NSEventModifierFlags NSControlKeyMask            API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagControl", macos(10.0,10.12)) = NSEventModifierFlagControl;
      |                                   ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:976:47: warning: 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  976 |                 else if ([(NSEvent *)event modifierFlags] & NSCommandKeyMask)
      |                                                             ^~~~~~~~~~~~~~~~
      |                                                             NSEventModifierFlagCommand
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:181:35: note: 'NSCommandKeyMask' has been explicitly marked deprecated here
  181 | static const NSEventModifierFlags NSCommandKeyMask            API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagCommand", macos(10.0,10.12)) = NSEventModifierFlagCommand;
      |                                   ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:1006:65: warning: 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
 1006 |                 ievent.MouseInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0;
      |                                                                               ^~~~~~~~~~~~~~
      |                                                                               NSEventModifierFlagShift
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:178:35: note: 'NSShiftKeyMask' has been explicitly marked deprecated here
  178 | static const NSEventModifierFlags NSShiftKeyMask              API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagShift", macos(10.0,10.12)) = NSEventModifierFlagShift;
      |                                   ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:1007:67: warning: 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
 1007 |                 ievent.MouseInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0;
      |                                                                                 ^~~~~~~~~~~~~~~~
      |                                                                                 NSEventModifierFlagControl
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:179:35: note: 'NSControlKeyMask' has been explicitly marked deprecated here
  179 | static const NSEventModifierFlags NSControlKeyMask            API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagControl", macos(10.0,10.12)) = NSEventModifierFlagControl;
      |                                   ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:1022:15: warning: 'convertScreenToBase:' is deprecated: first deprecated in macOS 10.7 - Use -convertRectFromScreen or -convertPointFromScreen: instead [-Wdeprecated-declarations]
 1022 |                 p = [Window convertScreenToBase:p];
      |                             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:997:1: note: 'convertScreenToBase:' has been explicitly marked deprecated here
  997 | - (NSPoint)convertScreenToBase:(NSPoint)point API_DEPRECATED("Use -convertRectFromScreen or -convertPointFromScreen: instead", macos(10.0,10.7));
      | ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:1058:15: warning: 'convertBaseToScreen:' is deprecated: first deprecated in macOS 10.7 - Use -convertRectToScreen: or -convertPointToScreen: instead [-Wdeprecated-declarations]
 1058 |                 p = [Window convertBaseToScreen:p];
      |                             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:996:1: note: 'convertBaseToScreen:' has been explicitly marked deprecated here
  996 | - (NSPoint)convertBaseToScreen:(NSPoint)point API_DEPRECATED("Use -convertRectToScreen: or -convertPointToScreen: instead", macos(10.0,10.7));
      | ^
/Users/stefanbeller/luanti/irr/src/CIrrDeviceOSX.mm:1266:11: warning: 'IOMasterPort' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
 1266 |         result = IOMasterPort(bootstrap_port, &masterPort);
      |                  ^~~~~~~~~~~~
      |                  kIOMainPortDefault
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:143:1: note: 'IOMasterPort' has been explicitly marked deprecated here
  143 | IOMasterPort( mach_port_t       bootstrapPort,
      | ^
37 warnings generated.


[ 21%] Building CXX object irr/src/CMakeFiles/IRROTHEROBJ.dir/CNSOGLManager.mm.o
In file included from /Users/stefanbeller/luanti/irr/src/CNSOGLManager.mm:5:
/Users/stefanbeller/luanti/irr/src/CNSOGLManager.h:49:27: warning: 'getContext' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   49 |         const SExposedVideoData &getContext() const;
      |                                  ^
/Users/stefanbeller/luanti/irr/include/IContextManager.h:38:35: note: overridden virtual function is here
   38 |         virtual const SExposedVideoData &getContext() const = 0;
      |                                          ^
/Users/stefanbeller/luanti/irr/src/CNSOGLManager.mm:150:41: warning: 'NSOpenGLCPSwapInterval' is deprecated: first deprecated in macOS 10.14 [-Wdeprecated-declarations]
  150 |         [Context setValues:&Vsync forParameter:NSOpenGLCPSwapInterval];
      |                                                ^~~~~~~~~~~~~~~~~~~~~~
      |                                                NSOpenGLContextParameterSwapInterval
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGL.h:258:39: note: 'NSOpenGLCPSwapInterval' has been explicitly marked deprecated here
  258 | static const NSOpenGLContextParameter NSOpenGLCPSwapInterval API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterSwapInterval", macos(10.5,10.14)) = NSOpenGLContextParameterSwapInterval;
      |                                       ^
/Users/stefanbeller/luanti/irr/src/CNSOGLManager.mm:215:6: warning: 'NSIsSymbolNameDefined' is deprecated: first deprecated in macOS 10.4 - dlsym() [-Wdeprecated-declarations]
  215 |         if (NSIsSymbolNameDefined(mangledName.c_str()))
      |             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/usr/include/mach-o/dyld.h:202:17: note: 'NSIsSymbolNameDefined' has been explicitly marked deprecated here
  202 | extern bool     NSIsSymbolNameDefined(const char* symbolName)                                                    __API_UNAVAILABLE(ios, tvos, watchos)  DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
      |                 ^
/Users/stefanbeller/luanti/irr/src/CNSOGLManager.mm:216:12: warning: 'NSLookupAndBindSymbol' is deprecated: first deprecated in macOS 10.4 - dlsym() [-Wdeprecated-declarations]
  216 |                 symbol = NSLookupAndBindSymbol(mangledName.c_str());
      |                          ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/usr/include/mach-o/dyld.h:205:17: note: 'NSLookupAndBindSymbol' has been explicitly marked deprecated here
  205 | extern NSSymbol NSLookupAndBindSymbol(const char* symbolName)                                                    __API_UNAVAILABLE(ios, tvos, watchos)  DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
      |                 ^
/Users/stefanbeller/luanti/irr/src/CNSOGLManager.mm:217:18: warning: 'NSAddressOfSymbol' is deprecated: first deprecated in macOS 10.5 - dlsym() [-Wdeprecated-declarations]
  217 |         return symbol ? NSAddressOfSymbol(symbol) : NULL;
      |                         ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.2.sdk/usr/include/mach-o/dyld.h:214:21: note: 'NSAddressOfSymbol' has been explicitly marked deprecated here
  214 | extern void *       NSAddressOfSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos)  DYLD_DRIVERKIT_UNAVAILABLE DYLD_EXCLAVEKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
      |                     ^
5 warnings generated.


[ 75%] Building CXX object src/CMakeFiles/luanti.dir/porting.cpp.o
/Users/stefanbeller/luanti/src/porting.cpp:284:13: warning: unused function 'getExecPathFromProcfs' [-Wunused-function]
  284 | static bool getExecPathFromProcfs(char *buf, size_t buflen)
      |             ^~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Copy link
Contributor

@sfence sfence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works also with Luanti built for MacOS 11.

@sfence
Copy link
Contributor

sfence commented Jan 27, 2025

@stefanbeller We will probably switch to SDL2 or SDL3 in future. So, I see no need to fix all this deprecated code (which also causes some bugs).

@stefanbeller
Copy link
Contributor Author

@sfence In that case, I'll leave the PR as is.

@SmallJoker SmallJoker merged commit 63e9b01 into luanti-org:master Feb 1, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants