emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix deprecation warning


From: Alan Third
Subject: [PATCH] Fix deprecation warning
Date: Wed, 26 Sep 2018 22:36:52 +0100
User-agent: Mutt/1.10.1 (2018-07-13)

* src/nsterm.m (ns_term_init): Use writeToFile or writeToURL as
required.
---
I believe this should fix the colour list error.

 src/nsterm.m | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index 954020dcde..d92d6c3244 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5193,7 +5193,21 @@ Needs to be here because ns_initialize_display_info () 
uses AppKit classes.
                                       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
       }
   }
 
-- 
2.18.0


-- 
Alan Third



reply via email to

[Prev in Thread] Current Thread [Next in Thread]