From 6a5a6d54cc4ffba4660dbd176c1074ed845134ae Mon Sep 17 00:00:00 2001 From: dmaclach Date: Tue, 13 Nov 2018 20:49:19 -0800 Subject: Deprecate GTMFileSystemKqueue. (#204) You should use libdispatch with a DISPATCH_SOURCE_TYPE_VNODE source. --- Foundation/GTMFileSystemKQueue.h | 1 + Foundation/GTMFileSystemKQueue.m | 6 ++++++ Foundation/GTMFileSystemKQueueTest.m | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/Foundation/GTMFileSystemKQueue.h b/Foundation/GTMFileSystemKQueue.h index a829154..96e93b3 100644 --- a/Foundation/GTMFileSystemKQueue.h +++ b/Foundation/GTMFileSystemKQueue.h @@ -45,6 +45,7 @@ typedef unsigned int GTMFileSystemKQueueEvents; // delivery, so keep that in mind when you're using this class. This class // explicitly does not handle arbitrary runloops and threading. // +NS_CLASS_DEPRECATED(10_2, 10_6, 2_0, 4_0, "Use libdispatch with DISPATCH_SOURCE_TYPE_VNODE source.") @interface GTMFileSystemKQueue : NSObject { @private NSString *path_; diff --git a/Foundation/GTMFileSystemKQueue.m b/Foundation/GTMFileSystemKQueue.m index a66dc47..7ed2f4e 100644 --- a/Foundation/GTMFileSystemKQueue.m +++ b/Foundation/GTMFileSystemKQueue.m @@ -96,6 +96,10 @@ static CFSocketRef gRunLoopSocket = NULL; return path_; } +#pragma clang diagnostic push +// Ignore all of the deprecation warnings for GTMFileSystemKQueue +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // Cribbed from Advanced Mac OS X Programming. static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) { @@ -136,6 +140,8 @@ static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, [pool drain]; } +#pragma clang diagnostic pop + // Cribbed from Advanced Mac OS X Programming - (void)addFileDescriptorMonitor:(int)fd { _GTMDevAssert(gRunLoopSocket == NULL, @"socket should be NULL at this point"); diff --git a/Foundation/GTMFileSystemKQueueTest.m b/Foundation/GTMFileSystemKQueueTest.m index 9ffc046..2dad7b7 100644 --- a/Foundation/GTMFileSystemKQueueTest.m +++ b/Foundation/GTMFileSystemKQueueTest.m @@ -20,6 +20,10 @@ #import "GTMFileSystemKQueue.h" +#pragma clang diagnostic push +// Ignore all of the deprecation warnings for GTMFileSystemKQueue +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // Private methods of GTMFileSystemKQueue we use for some tests @interface GTMFileSystemKQueue (PrivateMethods) - (void)unregisterWithKQueue; @@ -508,3 +512,5 @@ } @end + +#pragma clang diagnostic pop -- cgit v1.2.3