]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix deprecation warning
authorAlan Third <alan@idiocy.org>
Wed, 26 Sep 2018 21:21:37 +0000 (22:21 +0100)
committerAlan Third <alan@idiocy.org>
Fri, 28 Sep 2018 19:23:46 +0000 (20:23 +0100)
* src/nsterm.m (ns_term_init): Use writeToFile or writeToURL as
required.

src/nsterm.m

index 954020dcde916e5704525043869f52245c366bb4..d92d6c32448da178ed0a80238a5458ef6761d4ae 100644 (file)
@@ -5193,7 +5193,21 @@ ns_term_init (Lisp_Object display_name)
                                       alpha: 1.0]
                   forKey: [NSString stringWithUTF8String: name]];
           }
-        [cl writeToFile: nil];
+
+        /* FIXME: Report any errors writing the color file below.  */
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101100
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101100
+        if ([cl respondsToSelector:@selector(writeToURL:error:)])
+#endif
+          [cl writeToURL:nil error:nil];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101100
+        else
+#endif
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 101100 */
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101100 \
+  || defined (NS_IMPL_GNUSTEP)
+          [cl writeToFile: nil];
+#endif
       }
   }