diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-06-21 23:37:49 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-06-22 21:09:37 +0200 |
commit | 0d5d3083bd6f0f3c51b15d58a6cb525912e1b775 (patch) | |
tree | 5d76eeb4100c7ba023212b773c21a925983fe743 /src/os | |
parent | 8c1b89e1079e411a2a87f2faae4c8546de6979de (diff) | |
download | openttd-0d5d3083bd6f0f3c51b15d58a6cb525912e1b775.tar.xz |
Codechange: [OSX] Use more exact enum names where introduced with the 10.12 SDK.
The enum values still have the exact same numerical values, but the 10.12
SDK introduced more explicit names (e.g. like NSEventTypeApplicationDefined
instead of NSApplicationDefined) for several enum constants.
Use them when available.
Diffstat (limited to 'src/os')
-rw-r--r-- | src/os/macosx/macos.mm | 4 | ||||
-rw-r--r-- | src/os/macosx/osx_stdafx.h | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/os/macosx/macos.mm b/src/os/macosx/macos.mm index 6f0ab8d63..90bcd6dc4 100644 --- a/src/os/macosx/macos.mm +++ b/src/os/macosx/macos.mm @@ -191,13 +191,13 @@ const char *GetCurrentLocale(const char *) bool GetClipboardContents(char *buffer, const char *last) { NSPasteboard *pb = [ NSPasteboard generalPasteboard ]; - NSArray *types = [ NSArray arrayWithObject:NSStringPboardType ]; + NSArray *types = [ NSArray arrayWithObject:NSPasteboardTypeString ]; NSString *bestType = [ pb availableTypeFromArray:types ]; /* Clipboard has no text data available. */ if (bestType == nil) return false; - NSString *string = [ pb stringForType:NSStringPboardType ]; + NSString *string = [ pb stringForType:NSPasteboardTypeString ]; if (string == nil || [ string length ] == 0) return false; strecpy(buffer, [ string UTF8String ], last); diff --git a/src/os/macosx/osx_stdafx.h b/src/os/macosx/osx_stdafx.h index e147fcf74..9c4276d05 100644 --- a/src/os/macosx/osx_stdafx.h +++ b/src/os/macosx/osx_stdafx.h @@ -26,6 +26,10 @@ #define HAVE_OSX_1011_SDK #endif +#ifdef MAC_OS_X_VERSION_10_12 +#define HAVE_OSX_1012_SDK +#endif + /* It would seem that to ensure backward compatibility we have to ensure that we have defined MAC_OS_X_VERSION_10_x everywhere */ #ifndef MAC_OS_X_VERSION_10_3 #define MAC_OS_X_VERSION_10_3 1030 |