diff --git a/src/macfont.m b/src/macfont.m
index 34e48af..eaac47e 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -3570,18 +3570,17 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
 
       if (languages && CFArrayGetCount (languages) > 0)
         {
-          if ([[NSProcessInfo processInfo]
-                isOperatingSystemAtLeastVersion:
-                  ((NSOperatingSystemVersion){
-                    .majorVersion = 10, .minorVersion = 9})])
-            values[num_values++] = CFArrayGetValueAtIndex (languages, 0);
-          else
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 10900
+          if (CTGetCoreTextVersion () < kCTVersionNumber10_9)
             {
               CFCharacterSetRef charset =
                 CFDictionaryGetValue (attributes, kCTFontCharacterSetAttribute);
 
               result = mac_font_copy_default_name_for_charset_and_languages (charset, languages);
             }
+          else
+#endif
+            values[num_values++] = CFArrayGetValueAtIndex (languages, 0);
         }
       if (result == NULL)
         {
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 81d7cd2..0f7d1fb 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -649,7 +649,8 @@ - (void)fillWithWidgetValue: (void *)wvptr
      work around it by using tabs to split the title into two
      columns.  */
   NSFont *menuFont = [NSFont menuFontOfSize:0];
-  NSDictionary *font_attribs = @{NSFontAttributeName: menuFont};
+  NSDictionary *font_attribs = [NSDictionary dictionaryWithObjectsAndKeys:
+                                               menuFont, NSFontAttributeName, nil];
   CGFloat maxNameWidth = 0;
   CGFloat maxKeyWidth = 0;
 
@@ -677,11 +678,12 @@ - (void)fillWithWidgetValue: (void *)wvptr
   NSTextTab *tab =
     [[[NSTextTab alloc] initWithTextAlignment: NSTextAlignmentRight
                                      location: maxWidth
-                                      options: @{}] autorelease];
+                                      options: [NSDictionary dictionary]] autorelease];
   NSMutableParagraphStyle *pstyle = [[[NSMutableParagraphStyle alloc] init]
                                       autorelease];
-  [pstyle setTabStops: @[tab]];
-  attributes = @{NSParagraphStyleAttributeName: pstyle};
+  [pstyle setTabStops: [NSArray arrayWithObject:tab]];
+  attributes = [NSDictionary dictionaryWithObjectsAndKeys:
+                               pstyle, NSParagraphStyleAttributeName, nil];
 #endif
 
   /* clear existing contents */
diff --git a/src/nsterm.h b/src/nsterm.h
index 4cba5c0..bf5ba7d 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1291,7 +1291,7 @@ #define NSAlertStyleCritical               NSCriticalAlertStyle
 #define NSControlSizeRegular               NSRegularControlSize
 #define NSCompositingOperationCopy         NSCompositeCopy
 
-/* And adds NSWindowStyleMask.  */
+#define NSTextAlignmentRight               NSRightTextAlignment
 #ifdef __OBJC__
 typedef NSUInteger NSWindowStyleMask;
 #endif
diff --git a/src/nsterm.m b/src/nsterm.m
index 5a6a4d6..5bf56df 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -163,7 +163,7 @@ - (NSColor *)colorUsingDefaultColorSpace
       && NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
     return [self colorUsingColorSpace: [NSColorSpace sRGBColorSpace]];
 #endif
-  return [self colorUsingColorSpace: [NSColorSpace deviceRGBColorSpace]];
+  return [self colorUsingColorSpace: [NSColorSpace genericRGBColorSpace]];
 }
 
 + (NSColor *)colorWithUnsignedLong:(unsigned long)c
@@ -751,7 +751,19 @@ Free a pool and temporary objects it refers to (callable from C)
       EmacsView *parentView = FRAME_NS_VIEW (FRAME_PARENT_FRAME (f));
       parentRect = [parentView convertRect:[parentView frame]
                                     toView:nil];
-      parentRect = [[parentView window] convertRectToScreen:parentRect];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+      if ([[parentView window] respondsToSelector: @selector(convertRectToScreen:)])
+#endif
+ parentRect = [[parentView window] convertRectToScreen: parentRect];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+      else
+#endif
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 */
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 \
+  || defined (NS_IMPL_GNUSTEP)
+ parentRect.origin = [[parentView window] convertBaseToScreen: parentRect.origin];
+#endif
     }
   else
     parentRect = [[[NSScreen screens] objectAtIndex:0] frame];
@@ -788,8 +800,15 @@ Free a pool and temporary objects it refers to (callable from C)
 double
 ns_frame_scale_factor (struct frame *f)
 {
-#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > 1060
-  return [[FRAME_NS_VIEW (f) window] backingScaleFactor];
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > 1068
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+  if ([[FRAME_NS_VIEW (f) window] respondsToSelector: @selector(convertRectToScreen:)])
+#endif
+    return [[FRAME_NS_VIEW (f) window] backingScaleFactor];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+  else
+    return [[FRAME_NS_VIEW (f) window] userSpaceScaleFactor];
+#endif
 #else
   return [[FRAME_NS_VIEW (f) window] userSpaceScaleFactor];
 #endif
@@ -6942,7 +6961,7 @@ - (void)otherMouseDragged: (NSEvent *)e
   [self mouseMoved: e];
 }
 
-#ifdef NS_IMPL_COCOA
+#if defined NS_IMPL_COCOA && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
 - (void) magnifyWithEvent: (NSEvent *) event
 {
   NSPoint pt = [self convertPoint: [event locationInWindow] fromView: nil];
@@ -6959,11 +6978,18 @@ - (void) magnifyWithEvent: (NSEvent *) event
 
       if ([event phase] == NSEventPhaseBegan)
 	{
-	  last_scale = 1.0 + [event magnification];
-	  emacs_event->arg = list4 (make_float (0.0),
-				    make_float (0.0),
-				    make_float (last_scale),
-				    make_float (0.0));
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+   if ([event respondsToSelector: @selector(magnification)])
+     {
+#endif
+       last_scale = 1.0 + [event magnification];
+       emacs_event->arg = list4 (make_float (0.0),
+     make_float (0.0),
+     make_float (last_scale),
+     make_float (0.0));
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+     }
+#endif
 	}
       else
 	/* Report a tiny change so that Lisp code doesn't think this
@@ -8454,7 +8480,7 @@ - (instancetype) initWithEmacsFrame:(struct frame *)f
       /* macOS Sierra automatically enables tabbed windows.  We can't
          allow this to be enabled until it's available on a Free system.
          Currently it only happens by accident and is buggy anyway.  */
-#ifdef NS_IMPL_COCOA
+#if defined NS_IMPL_COCOA && MAC_OS_X_VERSION_MAX_ALLOWED >= 101200
       if ([self respondsToSelector:@selector(setTabbingMode:)])
         [self setTabbingMode:NSWindowTabbingModeDisallowed];
 #endif
@@ -8524,14 +8550,16 @@ - (void)setParentChildRelationships
      behaviors early otherwise child windows may not go fullscreen as
      expected later.  */
 
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
-  if ([child respondsToSelector:@selector(setAccessibilitySubrole:)])
+  if ([self respondsToSelector:@selector(setAccessibilitySubrole:)])
 #endif
     /* Set the accessibility subroles.  */
     if (parentFrame)
       [self setAccessibilitySubrole:NSAccessibilityFloatingWindowSubrole];
     else
       [self setAccessibilitySubrole:NSAccessibilityStandardWindowSubrole];
+#endif
 
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
   [ourView updateCollectionBehavior];
@@ -8557,7 +8585,7 @@ - (void)setParentChildRelationships
 
 #ifdef NS_IMPL_COCOA
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
-      if ([ourView respondsToSelector:@selector (toggleFullScreen)]
+      if ([ourView respondsToSelector:@selector (toggleFullScreen)])
 #endif
           /* If we are the descendent of a fullscreen window and we
              have no new parent, go fullscreen.  */
@@ -8582,11 +8610,11 @@ - (void)setParentChildRelationships
 
 #ifdef NS_IMPL_COCOA
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
-      if ([ourView respondsToSelector:@selector (toggleFullScreen)]
+      if ([ourView respondsToSelector:@selector (toggleFullScreen)])
 #endif
-          /* Child frames must not be fullscreen.  */
-          if ([ourView fsIsNative] && [ourView isFullscreen])
-            [ourView toggleFullScreen:self];
+ /* Child frames must not be fullscreen.  */
+ if ([ourView fsIsNative] && [ourView isFullscreen])
+   [ourView toggleFullScreen:self];
 #endif
 
       [parentWindow addChildWindow:self
