Revision: 13868
          http://sourceforge.net/p/skim-app/code/13868
Author:   hofman
Date:     2023-12-09 18:03:45 +0000 (Sat, 09 Dec 2023)
Log Message:
-----------
define separate macros for SDK version checks

Modified Paths:
--------------
    trunk/NSGraphics_SKExtensions.m
    trunk/SKAttachmentEmailer.m
    trunk/SKBasePDFView.m
    trunk/SKCompatibility.h
    trunk/SKMainWindowController_FullScreen.m

Modified: trunk/NSGraphics_SKExtensions.m
===================================================================
--- trunk/NSGraphics_SKExtensions.m     2023-12-09 17:49:40 UTC (rev 13867)
+++ trunk/NSGraphics_SKExtensions.m     2023-12-09 18:03:45 UTC (rev 13868)
@@ -44,7 +44,7 @@
 #import "SKStringConstants.h"
 
 
-#if SDK_BEFORE(10_14)
+#if SDK_BEFORE_10_14
 
 @interface NSAppearance (SKMojaveExtensions)
 - (NSString *)bestMatchFromAppearancesWithNames:(NSArray *)names;

Modified: trunk/SKAttachmentEmailer.m
===================================================================
--- trunk/SKAttachmentEmailer.m 2023-12-09 17:49:40 UTC (rev 13867)
+++ trunk/SKAttachmentEmailer.m 2023-12-09 18:03:45 UTC (rev 13868)
@@ -39,7 +39,7 @@
 #import "SKAttachmentEmailer.h"
 #import "NSString_SKExtensions.h"
 
-#if !SDK_BEFORE(10_14)
+#if !SDK_BEFORE_10_14
 extern OSStatus AEDeterminePermissionToAutomateTarget( const AEAddressDesc* 
target, AEEventClass theAEEventClass, AEEventID theAEEventID, Boolean 
askUserIfNeeded ) WEAK_IMPORT_ATTRIBUTE;
 #endif
 
@@ -78,7 +78,7 @@
 }
 
 - (BOOL)permissionToComposeMessage {
-#if !SDK_BEFORE(10_14)
+#if !SDK_BEFORE_10_14
     if (@available(macOS 10.14, *)) {
         NSAppleEventDescriptor *targetDescriptor = [NSAppleEventDescriptor 
descriptorWithBundleIdentifier:mailAppID];
         return noErr == 
AEDeterminePermissionToAutomateTarget(targetDescriptor.aeDesc, typeWildCard, 
typeWildCard, true);

Modified: trunk/SKBasePDFView.m
===================================================================
--- trunk/SKBasePDFView.m       2023-12-09 17:49:40 UTC (rev 13867)
+++ trunk/SKBasePDFView.m       2023-12-09 18:03:45 UTC (rev 13868)
@@ -53,7 +53,7 @@
 // don't use the constant, which is only defined on 10.13+
 #define kPDFDestinationUnspecifiedValue FLT_MAX
 
-#if SDK_BEFORE(10_14)
+#if SDK_BEFORE_10_14
 @interface PDFView (SKMojaveDeclarations)
 @property (nonatomic, setter=enablePageShadows:) BOOL pageShadowsEnabled;
 @end

Modified: trunk/SKCompatibility.h
===================================================================
--- trunk/SKCompatibility.h     2023-12-09 17:49:40 UTC (rev 13867)
+++ trunk/SKCompatibility.h     2023-12-09 18:03:45 UTC (rev 13868)
@@ -38,42 +38,15 @@
 
 #import <Cocoa/Cocoa.h>
 
-#define SDK_BEFORE(_version) (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_VERSION_ 
## _version)
-#define DEPLOYMENT_BEFORE(_version) (MAC_OS_X_VERSION_MIN_REQUIRED < 
MAC_OS_VERSION_ ## _version)
+#define SDK_BEFORE_10_14 (MAC_OS_X_VERSION_MAX_ALLOWED < 101400)
+#define SDK_BEFORE_10_15 (MAC_OS_X_VERSION_MAX_ALLOWED < 101500)
+#define SDK_BEFORE_11_0  (MAC_OS_X_VERSION_MAX_ALLOWED < 110000)
+#define SDK_BEFORE_12_0  (MAC_OS_X_VERSION_MAX_ALLOWED < 120000)
+#define SDK_BEFORE_13_0  (MAC_OS_X_VERSION_MAX_ALLOWED < 130000)
+#define SDK_BEFORE_14_0  (MAC_OS_X_VERSION_MAX_ALLOWED < 140000)
 
-#ifdef MAC_OS_X_VERSION_10_14
-    #define MAC_OS_VERSION_10_14 MAC_OS_X_VERSION_10_14
-#else
-    #define MAC_OS_VERSION_10_14 101400
-#endif
-#ifdef MAC_OS_X_VERSION_10_15
-    #define MAC_OS_VERSION_10_15 MAC_OS_X_VERSION_10_15
-#else
-    #define MAC_OS_VERSION_10_15 101500
-#endif
-#ifdef MAC_OS_X_VERSION_10_16
-    #define MAC_OS_VERSION_10_16 MAC_OS_X_VERSION_10_16
-#else
-    #define MAC_OS_VERSION_10_16 101600
-#endif
-#ifndef MAC_OS_VERSION_11_0
-    #define MAC_OS_VERSION_11_0 110000
-#endif
-#ifndef MAC_OS_VERSION_11_1
-    #define MAC_OS_VERSION_11_1 110100
-#endif
-#ifndef MAC_OS_VERSION_12_0
-    #define MAC_OS_VERSION_12_0 120000
-#endif
-#ifndef MAC_OS_VERSION_13_0
-    #define MAC_OS_VERSION_13_0 130000
-#endif
-#ifndef MAC_OS_VERSION_14_0
-    #define MAC_OS_VERSION_14_0 140000
-#endif
+#if SDK_BEFORE_10_14
 
-#if SDK_BEFORE(10_14)
-
 enum {
     NSVisualEffectMaterialHeaderView = 10,
     NSVisualEffectMaterialSheet = 11,
@@ -94,7 +67,7 @@
 
 #endif
 
-#if SDK_BEFORE(11_0)
+#if SDK_BEFORE_11_0
 
 typedef NS_ENUM(NSInteger, NSWindowToolbarStyle) {
     NSWindowToolbarStyleAutomatic,
@@ -105,8 +78,7 @@
 };
 
 @interface NSWindow (SKBigSurDeclarations)
-- (NSWindowToolbarStyle)toolbarStyle;
-- (void)setToolbarStyle:(NSWindowToolbarStyle)style;
+@property NSWindowToolbarStyle toolbarStyle;
 @end
 
 typedef NS_ENUM(NSInteger, NSTableViewStyle) {

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2023-12-09 17:49:40 UTC (rev 
13867)
+++ trunk/SKMainWindowController_FullScreen.m   2023-12-09 18:03:45 UTC (rev 
13868)
@@ -88,7 +88,7 @@
 
 static CGFloat fullScreenToolbarOffset = 0.0;
 
-#if SDK_BEFORE(10_14)
+#if SDK_BEFORE_10_14
 @interface PDFView (SKMojaveDeclarations)
 @property (nonatomic, setter=enablePageShadows:) BOOL pageShadowsEnabled;
 @end

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to